Author: Ronan Lamy <ronan.l...@gmail.com> Branch: py3tests Changeset: r94363:18e33a4f6b3e Date: 2018-04-17 22:22 +0100 http://bitbucket.org/pypy/pypy/changeset/18e33a4f6b3e/
Log: fix fix fix diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py --- a/pypy/interpreter/baseobjspace.py +++ b/pypy/interpreter/baseobjspace.py @@ -566,22 +566,22 @@ def make_builtins(self): "only for initializing the space." - from pypy.module.exceptions import Module + from pypy.module.exceptions.moduledef import Module w_name = self.newtext('__exceptions__') self.exceptions_module = Module(self, w_name) self.exceptions_module.install() - from pypy.module.imp import Module + from pypy.module.imp.moduledef import Module w_name = self.newtext('_imp') mod = Module(self, w_name) mod.install() - from pypy.module.sys import Module + from pypy.module.sys.moduledef import Module w_name = self.newtext('sys') self.sys = Module(self, w_name) self.sys.install() - from pypy.module.__builtin__ import Module + from pypy.module.__builtin__.moduledef import Module w_name = self.newtext('builtins') self.builtin = Module(self, w_name) w_builtin = self.builtin diff --git a/pypy/interpreter/mixedmodule.py b/pypy/interpreter/mixedmodule.py --- a/pypy/interpreter/mixedmodule.py +++ b/pypy/interpreter/mixedmodule.py @@ -173,7 +173,7 @@ # build a constant dictionary out of # applevel/interplevel definitions cls.loaders = loaders = {} - pkgroot = cls.__module__ + pkgroot = cls.__module__.rsplit('.', 1)[0] appname = cls.get_applevel_name() if cls.submodule_name is not None: appname += '.%s' % (cls.submodule_name,) diff --git a/pypy/interpreter/test/test_extmodules.py b/pypy/interpreter/test/test_extmodules.py --- a/pypy/interpreter/test/test_extmodules.py +++ b/pypy/interpreter/test/test_extmodules.py @@ -5,7 +5,7 @@ from pypy.objspace.std.objspace import StdObjSpace from rpython.tool.udir import udir -mod_init = """ +mod_def = """ from pypy.interpreter.mixedmodule import MixedModule import time @@ -45,14 +45,15 @@ pkg.join("__init__.py").write("# package") mod = pkg.join("extmod") mod.ensure(dir=True) - mod.join("__init__.py").write(mod_init) + mod.join("__init__.py").write("#") mod.join("interp_time.py").write(mod_interp) + mod.join("moduledef.py").write(mod_def) class AppTestExtModules(object): def setup_class(cls): init_extmodule_code() conf = get_pypy_config() - conf.objspace.extmodules = 'testext.extmod' + conf.objspace.extmodules = 'testext.extmod.moduledef' old_sys_path[:] = sys.path[:] sys.path.insert(0, str(udir)) space = StdObjSpace(conf) diff --git a/pypy/module/_codecs/interp_codecs.py b/pypy/module/_codecs/interp_codecs.py --- a/pypy/module/_codecs/interp_codecs.py +++ b/pypy/module/_codecs/interp_codecs.py @@ -10,7 +10,7 @@ from pypy.interpreter.error import OperationError, oefmt from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault from pypy.interpreter import unicodehelper -from pypy.module.unicodedata import unicodedb +from pypy.module.unicodedata.interp_ucd import unicodedb class VersionTag(object): diff --git a/pypy/module/unicodedata/interp_ucd.py b/pypy/module/unicodedata/interp_ucd.py --- a/pypy/module/unicodedata/interp_ucd.py +++ b/pypy/module/unicodedata/interp_ucd.py @@ -342,3 +342,8 @@ ucd_3_2_0 = UCD(unicodedb_3_2_0) ucd_8_0_0 = UCD(unicodedb_8_0_0) ucd = ucd_8_0_0 + +# This is the default unicodedb used in various places: +# - the unicode type +# - the regular expression engine +unicodedb = ucd._unicodedb diff --git a/pypy/module/unicodedata/moduledef.py b/pypy/module/unicodedata/moduledef.py --- a/pypy/module/unicodedata/moduledef.py +++ b/pypy/module/unicodedata/moduledef.py @@ -1,14 +1,5 @@ from pypy.interpreter.mixedmodule import MixedModule -# This is the default unicodedb used in various places: -# - the unicode type -# - the regular expression engine -from pypy.module.unicodedata.interp_ucd import ucd as _ucd -unicodedb = _ucd._unicodedb - -# to get information about individual unicode chars look at: -# http://www.fileformat.info/info/unicode/char/search.htm - class Module(MixedModule): appleveldefs = { } diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py --- a/pypy/objspace/std/unicodeobject.py +++ b/pypy/objspace/std/unicodeobject.py @@ -15,7 +15,7 @@ from pypy.interpreter.error import OperationError, oefmt from pypy.interpreter.gateway import WrappedDefault, interp2app, unwrap_spec from pypy.interpreter.typedef import TypeDef -from pypy.module.unicodedata import unicodedb +from pypy.module.unicodedata.interp_ucd import unicodedb from pypy.objspace.std import newformat from pypy.objspace.std.formatting import mod_format, FORMAT_UNICODE from pypy.objspace.std.stringmethods import StringMethods diff --git a/pypy/tool/pytest/fake_pytest/__init__.py b/pypy/tool/pytest/fake_pytest/__init__.py --- a/pypy/tool/pytest/fake_pytest/__init__.py +++ b/pypy/tool/pytest/fake_pytest/__init__.py @@ -1,12 +0,0 @@ -from pypy.interpreter.mixedmodule import MixedModule - -class Module(MixedModule): - applevel_name = 'pytest' - interpleveldefs = { - 'raises': 'interp_pytest.pypyraises', - 'skip': 'interp_pytest.pypyskip', - 'fixture': 'interp_pytest.fake_fixture', - } - appleveldefs = { - 'importorskip': 'app_pytest.importorskip', - } diff --git a/pypy/tool/pytest/fake_pytest/__init__.py b/pypy/tool/pytest/fake_pytest/moduledef.py copy from pypy/tool/pytest/fake_pytest/__init__.py copy to pypy/tool/pytest/fake_pytest/moduledef.py diff --git a/pypy/tool/pytest/objspace.py b/pypy/tool/pytest/objspace.py --- a/pypy/tool/pytest/objspace.py +++ b/pypy/tool/pytest/objspace.py @@ -30,7 +30,7 @@ config = make_config(option) if config.objspace.usemodules.thread: config.translation.thread = True - config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest' + config.objspace.extmodules = 'pypy.tool.pytest.fake_pytest.moduledef' space = make_objspace(config) space.startup() # Initialize all builtin modules if config.objspace.std.reinterpretasserts: _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit