Author: Matti Picus <[email protected]>
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
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit