[pypy-commit] pypy default: merge
cfbolz
pypy.commits at gmail.com
Wed Sep 7 10:14:39 EDT 2016
Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch:
Changeset: r86937:cd6eb8be0310
Date: 2016-09-07 16:13 +0200
http://bitbucket.org/pypy/pypy/changeset/cd6eb8be0310/
Log: merge
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
@@ -358,6 +358,7 @@
w_all = try_getattr(space, w_mod, space.wrap('__all__'))
if w_all is not None:
w_fromlist = w_all
+ length = space.len_w(w_fromlist)
else:
w_fromlist = None
# "from x import *" with x already imported and no x.__all__
@@ -409,6 +410,7 @@
w_all = try_getattr(space, w_mod, w('__all__'))
if w_all is not None:
w_fromlist = w_all
+ length = space.len_w(w_fromlist)
else:
w_fromlist = None
if w_fromlist is not None:
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
@@ -65,8 +65,9 @@
)
setuppkg("pkg.pkg2", a='', b='')
setuppkg("pkg.withall",
- __init__ = "__all__ = ['foobar']",
- foobar = "found = 123")
+ __init__ = "__all__ = ['foobar', 'barbaz']",
+ foobar = "found = 123",
+ barbaz = "other = 543")
setuppkg("pkg.withoutall",
__init__ = "",
foobar = "found = 123")
@@ -707,6 +708,7 @@
d = {}
exec "from pkg.withall import *" in d
assert d["foobar"].found == 123
+ assert d["barbaz"].other == 543
def test_import_star_does_not_find_submodules_without___all__(self):
for case in ["not-imported-yet", "already-imported"]:
More information about the pypy-commit
mailing list