diff --git a/direct/src/showutil/FreezeTool.py b/direct/src/showutil/FreezeTool.py index 70903cf8f6..9c230367cc 100644 --- a/direct/src/showutil/FreezeTool.py +++ b/direct/src/showutil/FreezeTool.py @@ -6,7 +6,6 @@ import sys import os import marshal import imp -import struct import direct from pandac.PandaModules import * @@ -360,6 +359,19 @@ class Freezer: else: self.modules[moduleName] = self.MTExclude + def handleCustomPath(self, moduleName): + """ Indicates a module that may perform runtime manipulation + of its __path__ variable, and which must therefore be actually + imported at runtime in order to determine the true value of + __path__. """ + + str = 'import %s' % (moduleName) + exec str + + module = sys.modules[moduleName] + for path in module.__path__: + modulefinder.AddPackagePath(moduleName, path) + def getModulePath(self, moduleName): """ Looks for the indicated directory module and returns its __path__ member: the list of directories in which its python @@ -582,16 +594,16 @@ class Freezer: co = self.mf.replace_paths_in_code(module.__code__) module.__code__ = co; - def __addPyc(self, mf, filename, code): + def __addPyc(self, multifile, filename, code): if code: - data = imp.get_magic() + \ - struct.pack('