Browse Source

dist: fix exception when module has None __path__

rdb 6 years ago
parent
commit
92476a3788
1 changed files with 1 additions and 1 deletions
  1. 1 1
      direct/src/dist/FreezeTool.py

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

@@ -785,7 +785,7 @@ class Freezer:
         # already-imported modules.  (Some of them might do their own
         # already-imported modules.  (Some of them might do their own
         # special path mangling.)
         # special path mangling.)
         for moduleName, module in list(sys.modules.items()):
         for moduleName, module in list(sys.modules.items()):
-            if module and hasattr(module, '__path__'):
+            if module and getattr(module, '__path__', None) is not None:
                 path = list(getattr(module, '__path__'))
                 path = list(getattr(module, '__path__'))
                 if path:
                 if path:
                     modulefinder.AddPackagePath(moduleName, path[0])
                     modulefinder.AddPackagePath(moduleName, path[0])