Browse Source

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

Mitchell Stokes 8 years ago
parent
commit
d2d76c8a75
2 changed files with 4 additions and 4 deletions
  1. 3 3
      direct/src/showutil/FreezeTool.py
  2. 1 1
      direct/src/showutil/dist.py

+ 3 - 3
direct/src/showutil/FreezeTool.py

@@ -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))

+ 1 - 1
direct/src/showutil/dist.py

@@ -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