Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r78374:e83ef97376fe Date: 2015-07-01 11:08 +0200 http://bitbucket.org/pypy/pypy/changeset/e83ef97376fe/
Log: Fix for test_meta_path_import_star_2 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 @@ -349,9 +349,11 @@ w_all = try_getattr(space, w_mod, space.wrap('__all__')) if w_all is not None: fromlist_w = space.fixedview(w_all) - for w_name in fromlist_w: - if try_getattr(space, w_mod, w_name) is None: - return None + else: + # this only runs if fromlist_w != ['*'] + for w_name in fromlist_w: + if try_getattr(space, w_mod, w_name) is None: + return None return w_mod return first @@ -389,10 +391,12 @@ w_all = try_getattr(space, w_mod, w('__all__')) if w_all is not None: fromlist_w = space.fixedview(w_all) - for w_name in fromlist_w: - if try_getattr(space, w_mod, w_name) is None: - load_part(space, w_path, prefix, space.str0_w(w_name), - w_mod, tentative=1) + else: + # this only runs if fromlist_w != ['*'] + for w_name in fromlist_w: + if try_getattr(space, w_mod, w_name) is None: + load_part(space, w_path, prefix, space.str0_w(w_name), + w_mod, tentative=1) return w_mod else: return first _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit