Author: Brian Kearns <bdkea...@gmail.com> Branch: Changeset: r70041:16c7d08815c0 Date: 2014-03-18 01:58 -0400 http://bitbucket.org/pypy/pypy/changeset/16c7d08815c0/
Log: cleanup 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 @@ -247,12 +247,10 @@ fromlist_w = None rel_modulename = None - if (level != 0 and - w_globals is not None and - space.isinstance_w(w_globals, space.w_dict)): - - rel_modulename, rel_level = _get_relative_name(space, modulename, level, w_globals) - + if (level != 0 and w_globals is not None and + space.isinstance_w(w_globals, space.w_dict)): + rel_modulename, rel_level = _get_relative_name(space, modulename, level, + w_globals) if rel_modulename: # if no level was set, ignore import errors, and # fall back to absolute import at the end of the @@ -601,7 +599,7 @@ try: if find_info.modtype == PY_SOURCE: load_source_module( - space, w_modulename, w_mod, + space, w_modulename, w_mod, find_info.filename, find_info.stream.readall(), find_info.stream.try_to_find_file_descriptor()) return w_mod 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 @@ -174,7 +174,6 @@ import notapackage import warnings - warnings.simplefilter('error', ImportWarning) try: raises(ImportWarning, imp) @@ -412,7 +411,7 @@ def test_future_relative_import_level_1(self): from pkg import relative_c assert relative_c.inpackage == 1 - + def test_future_relative_import_level_2(self): from pkg.pkg1 import relative_d assert relative_d.inpackage == 1 @@ -670,10 +669,7 @@ import imp import pkg import os - - info = ('.py', 'r', imp.PY_SOURCE) pathname = os.path.join(os.path.dirname(pkg.__file__), 'a.py') - module = imp.load_module('a', open(pathname), 'invalid_path_name', ('.py', 'r', imp.PY_SOURCE)) assert module.__name__ == 'a' @@ -1128,7 +1124,7 @@ def load_module(self, name): sys.modules[name] = sys return sys - + def importer_for_path(path): if path == "xxx": return Importer() diff --git a/pypy/module/marshal/__init__.py b/pypy/module/marshal/__init__.py --- a/pypy/module/marshal/__init__.py +++ b/pypy/module/marshal/__init__.py @@ -8,7 +8,7 @@ appleveldefs = { } - + interpleveldefs = { 'dump' : 'interp_marshal.dump', 'dumps' : 'interp_marshal.dumps', _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit