[pypy-commit] pypy default: clean up test, fix for windows

mattip noreply at buildbot.pypy.org
Fri Apr 20 12:01:15 CEST 2012


Author: Matti Picus <matti.picus at gmail.com>
Branch: 
Changeset: r54567:b1d67b6d3c43
Date: 2012-04-20 12:59 +0300
http://bitbucket.org/pypy/pypy/changeset/b1d67b6d3c43/

Log:	clean up test, fix for windows

diff --git a/pypy/module/zipimport/interp_zipimport.py b/pypy/module/zipimport/interp_zipimport.py
--- a/pypy/module/zipimport/interp_zipimport.py
+++ b/pypy/module/zipimport/interp_zipimport.py
@@ -229,7 +229,11 @@
         startpos = fullname.rfind('.') + 1 # 0 when not found
         assert startpos >= 0
         subname = fullname[startpos:]
-        return self.prefix + subname.replace('.', '/')
+        if ZIPSEP == os.path.sep:
+            return self.prefix + subname.replace('.', '/')
+        else:
+            return self.prefix.replace(os.path.sep, ZIPSEP) + \
+                    subname.replace('.', '/')
 
     def make_co_filename(self, filename):
         """
diff --git a/pypy/module/zipimport/test/test_zipimport.py b/pypy/module/zipimport/test/test_zipimport.py
--- a/pypy/module/zipimport/test/test_zipimport.py
+++ b/pypy/module/zipimport/test/test_zipimport.py
@@ -313,13 +313,11 @@
         assert z.get_filename("package") == mod.__file__
 
     def test_subdirectory_twice(self):
-        import os, zipimport
+        #import os, zipimport
  
         self.writefile("package/__init__.py", "")
         self.writefile("package/subpackage/__init__.py", "")
         self.writefile("package/subpackage/foo.py", "")
-        import sys
-        print sys.path
         mod = __import__('package.subpackage.foo', None, None, [])
         assert mod
 


More information about the pypy-commit mailing list