Author: Brian Kearns <bdkea...@gmail.com> Branch: Changeset: r70045:7c6999457664 Date: 2014-03-18 03:48 -0400 http://bitbucket.org/pypy/pypy/changeset/7c6999457664/
Log: Backed out changeset 0ecfb7242213 diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py --- a/pypy/interpreter/baseobjspace.py +++ b/pypy/interpreter/baseobjspace.py @@ -432,11 +432,10 @@ return name - def getbuiltinmodule(self, name, force_init=False, reuse=True): + def getbuiltinmodule(self, name, force_init=False): w_name = self.wrap(name) w_modules = self.sys.get('modules') if not force_init: - assert reuse is True try: return self.getitem(w_modules, w_name) except OperationError, e: @@ -455,8 +454,6 @@ # And initialize it from pypy.interpreter.module import Module if isinstance(w_mod, Module): - if not reuse: - w_mod = type(w_mod)(self, w_name) w_mod.init(self) # Add the module to sys.modules diff --git a/pypy/module/imp/importing.py b/pypy/module/imp/importing.py --- a/pypy/module/imp/importing.py +++ b/pypy/module/imp/importing.py @@ -579,7 +579,7 @@ return space.call_method(find_info.w_loader, "load_module", w_modulename) if find_info.modtype == C_BUILTIN: - return space.getbuiltinmodule(find_info.filename, force_init=True, reuse=reuse) + return space.getbuiltinmodule(find_info.filename, force_init=True) if find_info.modtype in (PY_SOURCE, PY_COMPILED, C_EXTENSION, PKG_DIRECTORY): w_mod = None diff --git a/pypy/module/imp/test/test_app.py b/pypy/module/imp/test/test_app.py --- a/pypy/module/imp/test/test_app.py +++ b/pypy/module/imp/test/test_app.py @@ -203,6 +203,7 @@ def test_builtin_reimport(self): # from https://bugs.pypy.org/issue1514 + skip("fix me") import sys, marshal old = marshal.loads @@ -222,6 +223,7 @@ # taken from https://bugs.pypy.org/issue1514, with extra cases # that show a difference with CPython: we can get on CPython # several module objects for the same built-in module :-( + skip("several built-in module objects: not supported by pypy") import sys, marshal old = marshal.loads 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 @@ -578,6 +578,7 @@ assert hasattr(time, 'clock') def test_reimport_builtin_simple_case_2(self): + skip("fix me") import sys, time time.foo = "bar" del sys.modules['time'] @@ -585,6 +586,7 @@ assert not hasattr(time, 'foo') def test_reimport_builtin(self): + skip("fix me") import sys, time oldpath = sys.path time.tzset = "<test_reimport_builtin removed this>" _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit