Author: Antonio Cuni <[email protected]>
Branch: py3k
Changeset: r52937:fb993f9644b1
Date: 2012-02-27 15:33 +0100
http://bitbucket.org/pypy/pypy/changeset/fb993f9644b1/
Log: datetime is now imported from lib-python/3.2, which in turns does
other two imports from _datetime. Use 'math' instead, which is
builtin and so we are sure it doesn't do any import
diff --git a/pypy/module/imp/test/test_import.py
b/pypy/module/imp/test/test_import.py
--- a/pypy/module/imp/test/test_import.py
+++ b/pypy/module/imp/test/test_import.py
@@ -1012,24 +1012,24 @@
os.environ['LANG'] = oldlang
class AppTestImportHooks(object):
- def test_meta_path(self):
+ def test_meta_path_1(self):
tried_imports = []
class Importer(object):
def find_module(self, fullname, path=None):
tried_imports.append((fullname, path))
- import sys, datetime
- del sys.modules["datetime"]
+ import sys, math
+ del sys.modules["math"]
sys.meta_path.append(Importer())
try:
- import datetime
+ import math
assert len(tried_imports) == 1
package_name = '.'.join(__name__.split('.')[:-1])
if package_name:
- assert tried_imports[0][0] == package_name + ".datetime"
+ assert tried_imports[0][0] == package_name + ".math"
else:
- assert tried_imports[0][0] == "datetime"
+ assert tried_imports[0][0] == "math"
finally:
sys.meta_path.pop()
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit