From: <th...@us...> - 2003-10-28 11:51:25
|
Update of /cvsroot/py2exe/py2exe/sandbox/py2exe In directory sc8-pr-cvs1:/tmp/cvs-serv27714 Modified Files: build_exe.py Log Message: The special casing of zlib can be removed. py2exe arranges that both the shared zipfile *and* the directory it lives in are on sys.path. Maybe it would be nicer if only the zipfile were required on sys.path, but the pythoncom and pywintypes dlls would not be found then. The plus is that even compressed shared zipfiles can now be imported without any special casing of the zlib extension. Move the 'self.includes.append("warnings")' line into the plat_prepare() method where it belongs. Add a comment about a possible improvement. Index: build_exe.py =================================================================== RCS file: /cvsroot/py2exe/py2exe/sandbox/py2exe/build_exe.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** build_exe.py 28 Oct 2003 11:26:12 -0000 1.36 --- build_exe.py 28 Oct 2003 11:48:13 -0000 1.37 *************** *** 157,168 **** for target in dist.windows + dist.console] - ################ - # refactor, refactor, refactor! - - # XXX zlib is only needed for zipimport from compressed archives (?) - self.includes.append("zlib") # needed for zipimport - self.includes.append("warnings") # needed by Python itself - ## self.packages.append("encodings") - from modulefinder import ModuleFinder, ReplacePackage ReplacePackage("_xmlplus", "xml") --- 157,160 ---- *************** *** 619,632 **** def create_loader(self, item): - # Extension modules can not be loaded from zipfiles. - # So we create a small Python stub to be included in the zipfile, - # which will then load the extension from the file system. - # Without a need for the extensions directory to be in sys.path! - # - # For zlib there must be NO stub, otherwise zipimport wouldn't - # work correctly! - if item.__name__ == "zlib": - return - # Hm, how to avoid needless recreation of this file? pathname = os.path.join(self.temp_dir, "%s.py" % item.__name__) --- 611,614 ---- *************** *** 645,650 **** --- 627,637 ---- def plat_prepare(self): + self.includes.append("warnings") # needed by Python itself + ## self.packages.append("encodings") + # update the self.excludes list to exclude platform specific # modules + # XXX IMO it would be better to not add these to the excludes list, + # but instead filter them out *after* modulefinder has run. if sys.platform == "win32": self.excludes += ["os2", "posix", "dos", "mac", "macfs", "macfsn", |