Skip to content

Commit

Permalink
Eliminate dependence on pex.pex_bootstrapper.is_compressed API.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirois committed Mar 26, 2019
1 parent e7ac958 commit 5f332ce
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lambdex/resources/lambdex_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@
try:
# PEX >= 1.6.0
from pex.third_party.pkg_resources import EntryPoint as __EntryPoint
from pex.pex_bootstrapper import bootstrap_pex_env, is_compressed
from pex.pex_bootstrapper import bootstrap_pex_env
except ImportError:
# PEX < 1.6.0 has an install requirement of setuptools which we leverage knowledge of.
from pkg_resources import EntryPoint as __EntryPoint
from _pex.pex_bootstrapper import bootstrap_pex_env, is_compressed
from _pex.pex_bootstrapper import bootstrap_pex_env

bootstrap_pex_env(__entry_point__)

if is_compressed(__entry_point__):
import contextlib, zipfile
import zipfile
if zipfile.is_zipfile(__entry_point__):
import contextlib
with contextlib.closing(zipfile.ZipFile(__entry_point__)) as zf:
__lambdex_info_blob = zf.read('LAMBDEX-INFO')
else:
Expand Down

0 comments on commit 5f332ce

Please sign in to comment.