summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/_bootstrap.py
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2009-08-30 18:28:46 (GMT)
committerBrett Cannon <bcannon@gmail.com>2009-08-30 18:28:46 (GMT)
commit9e0e1a63c840b4d0fdf4d088ad4da2db7918f8a0 (patch)
tree18de2506ed9ceb344eb6a3c6b81f4f820a3d2137 /Lib/importlib/_bootstrap.py
parent12c3fc934376d89168f5b072a833aa7bdd4ecd60 (diff)
downloadcpython-9e0e1a63c840b4d0fdf4d088ad4da2db7918f8a0.zip
cpython-9e0e1a63c840b4d0fdf4d088ad4da2db7918f8a0.tar.gz
cpython-9e0e1a63c840b4d0fdf4d088ad4da2db7918f8a0.tar.bz2
Allow importlib.__import__ to accept any iterable for fromlist. Discovered when
running importlib against test___all__.
Diffstat (limited to 'Lib/importlib/_bootstrap.py')
-rw-r--r--Lib/importlib/_bootstrap.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/importlib/_bootstrap.py b/Lib/importlib/_bootstrap.py
index 079a9b2..95fea33 100644
--- a/Lib/importlib/_bootstrap.py
+++ b/Lib/importlib/_bootstrap.py
@@ -943,6 +943,7 @@ def __import__(name, globals={}, locals={}, fromlist=[], level=0):
# If a package was imported, try to import stuff from fromlist.
if hasattr(module, '__path__'):
if '*' in fromlist and hasattr(module, '__all__'):
+ fromlist = list(fromlist)
fromlist.remove('*')
fromlist.extend(module.__all__)
for x in (y for y in fromlist if not hasattr(module,y)):