mirror of
https://github.com/python/cpython.git
synced 2025-11-29 14:31:30 +00:00
test for presence of __builtins__ in names before deleting it, enabling this
to work with Jython (ugh! I hate that name!). This closes patch 103665.
This commit is contained in:
parent
b38175ef3d
commit
cc012e92b2
1 changed files with 2 additions and 1 deletions
|
|
@ -13,7 +13,8 @@ def check_all(modname):
|
||||||
"%s has no __all__ attribute" % modname)
|
"%s has no __all__ attribute" % modname)
|
||||||
names = {}
|
names = {}
|
||||||
exec "from %s import *" % modname in names
|
exec "from %s import *" % modname in names
|
||||||
del names["__builtins__"]
|
if names.has_key("__builtins__"):
|
||||||
|
del names["__builtins__"]
|
||||||
keys = names.keys()
|
keys = names.keys()
|
||||||
keys.sort()
|
keys.sort()
|
||||||
all = list(sys.modules[modname].__all__) # in case it's a tuple
|
all = list(sys.modules[modname].__all__) # in case it's a tuple
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue