From 808ca386c46ef70f53cfb5a1659e68ad76aa0d2f Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 23 Jul 2013 18:03:46 +0000 Subject: [PATCH] Fix error for modules where __file__ is None --- direct/src/showutil/FreezeTool.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/direct/src/showutil/FreezeTool.py b/direct/src/showutil/FreezeTool.py index 9200f132c9..7cfe976edc 100644 --- a/direct/src/showutil/FreezeTool.py +++ b/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__'