Skip pkg_resources.get_distribution call if frozen

Fixes: ticket:3259
This commit is contained in:
Chris Wood 2019-10-03 14:07:24 -04:00
parent 569a625907
commit 710af066d2

View File

@ -23,11 +23,21 @@ from .util import (
verlib, verlib,
) )
_INSTALL_REQUIRES = list( if getattr(sys, 'frozen', None):
str(req) # "Frozen" python interpreters (i.e., standalone executables
for req # generated by PyInstaller and other, similar utilities) run
in pkg_resources.get_distribution(__appname__).requires() # independently of a traditional setuptools-based packaging
) # environment, and so pkg_resources.get_distribution() cannot be
# used in such cases to gather a list of requirements at runtime
# (and because a frozen application is one that has already been
# "installed", an empty list suffices here).
_INSTALL_REQUIRES = []
else:
_INSTALL_REQUIRES = list(
str(req)
for req
in pkg_resources.get_distribution(__appname__).requires()
)
class PackagingError(EnvironmentError): class PackagingError(EnvironmentError):
""" """