deploy-ng: Fix finding pyd files in whl files on Windows

This commit is contained in:
Mitchell Stokes 2017-07-05 19:32:00 -07:00
parent 624f28f0d5
commit d2d76c8a75
2 changed files with 4 additions and 4 deletions

View File

@ -1760,7 +1760,7 @@ class PandaModuleFinder(modulefinder.ModuleFinder):
return None
try:
fp = zip.open(fn, 'r')
fp = zip.open(fn.replace(os.path.sep, '/'), 'r')
except KeyError:
return None
@ -1803,13 +1803,13 @@ class PandaModuleFinder(modulefinder.ModuleFinder):
# Look for recognized extensions.
for stuff in self.suffixes:
suffix, mode, type = stuff
suffix, mode, _ = stuff
fp = self._open_file(basename + suffix, mode)
if fp:
return (fp, basename + suffix, stuff)
# Consider a package, i.e. a directory containing __init__.py.
for suffix, mode, type in self.suffixes:
for suffix, mode, _ in self.suffixes:
init = os.path.join(basename, '__init__' + suffix)
if self._open_file(init, mode):
return (None, basename, ('', '', imp.PKG_DIRECTORY))

View File

@ -209,7 +209,7 @@ class build_apps(distutils.core.Command):
else:
# Builtin module, but might not be builtin in wheel libs, so double check
if module in whl_modules:
source_path = os.path.join(p3dwhlfn, 'deploy_libs/{}.{}'.format(module, whl_modules_ext))
source_path = os.path.join(p3dwhlfn, 'deploy_libs/{}.{}'.format(module, whl_modules_ext))#'{0}/deploy_libs/{1}.{2}'.format(p3dwhlfn, module, whl_modules_ext)
basename = os.path.basename(source_path)
else:
continue