Browse Source

Fix error for modules where __file__ is None

rdb 12 years ago
parent
commit
808ca386c4
1 changed files with 2 additions and 1 deletions
  1. 2 1
      direct/src/showutil/FreezeTool.py

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

@@ -1116,7 +1116,8 @@ class Freezer:
         filename = '/'.join(dirnames)
 
         module = self.mf.modules.get(mdef.moduleName, None)
-        if getattr(module, '__path__', None) is not None or getattr(module, '__file__', '').endswith('/__init__.py'):
+        if getattr(module, '__path__', None) is not None or \
+          (getattr(module, '__file__', None) is not None and getattr(module, '__file__').endswith('/__init__.py')):
             # It's actually a package.  In this case, we really write
             # the file moduleName/__init__.py.
             filename += '/__init__'