Преглед изворни кода

don't error if a module doesn't define __path__

rdb пре 14 година
родитељ
комит
4896c93827
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      direct/src/showutil/FreezeTool.py

+ 2 - 1
direct/src/showutil/FreezeTool.py

@@ -660,7 +660,8 @@ class Freezer:
         if module != None:
         if module != None:
             for symbol in moduleName.split('.')[1:]:
             for symbol in moduleName.split('.')[1:]:
                 module = getattr(module, symbol)
                 module = getattr(module, symbol)
-            return module.__path__
+            if hasattr(module, '__path__'):
+                return module.__path__
 
 
         # If it didn't work--maybe the module is unimportable because
         # If it didn't work--maybe the module is unimportable because
         # it makes certain assumptions about the builtins, or
         # it makes certain assumptions about the builtins, or