[pypy-svn] r64423 - pypy/release/1.1.x/pypy/module/zipimport

pedronis at codespeak.net pedronis at codespeak.net
Sun Apr 19 23:52:55 CEST 2009


Author: pedronis
Date: Sun Apr 19 23:52:53 2009
New Revision: 64423

Modified:
   pypy/release/1.1.x/pypy/module/zipimport/interp_zipimport.py
Log:
replay this now that the release is done



Modified: pypy/release/1.1.x/pypy/module/zipimport/interp_zipimport.py
==============================================================================
--- pypy/release/1.1.x/pypy/module/zipimport/interp_zipimport.py	(original)
+++ pypy/release/1.1.x/pypy/module/zipimport/interp_zipimport.py	Sun Apr 19 23:52:53 2009
@@ -137,10 +137,16 @@
             filename = filename.replace(os.path.sep, ZIPSEP)
         return filename
 
+    def corr_zname(self, fname):
+        if ZIPSEP != os.path.sep:
+            return fname.replace(ZIPSEP, os.path.sep)
+        else:
+            return fname
+
     def import_py_file(self, space, modname, filename, buf, pkgpath):
         w = space.wrap
         w_mod = w(Module(space, w(modname)))
-        real_name = self.name + os.path.sep + filename
+        real_name = self.name + os.path.sep + self.corr_zname(filename)
         space.setattr(w_mod, w('__loader__'), space.wrap(self))
         importing._prepare_module(space, w_mod, real_name, pkgpath)
         result = importing.load_source_module(space, w(modname), w_mod,
@@ -187,7 +193,7 @@
                                        pkgpath)
         buf = buf[8:] # XXX ugly copy, should use sequential read instead
         w_mod = w(Module(space, w(modname)))
-        real_name = self.name + os.path.sep + filename
+        real_name = self.name + os.path.sep + self.corr_zname(filename)
         space.setattr(w_mod, w('__loader__'), space.wrap(self))
         importing._prepare_module(space, w_mod, real_name, pkgpath)
         result = importing.load_compiled_module(space, w(modname), w_mod,



More information about the Pypy-commit mailing list