]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
test for presence of __builtins__ in names before deleting it, enabling this
authorSkip Montanaro <skip@pobox.com>
Wed, 7 Feb 2001 22:46:55 +0000 (22:46 +0000)
committerSkip Montanaro <skip@pobox.com>
Wed, 7 Feb 2001 22:46:55 +0000 (22:46 +0000)
to work with Jython (ugh! I hate that name!).  This closes patch 103665.

Lib/test/test___all__.py

index 853a816edff18b38483a421b7968739bcc33511d..a3ae9564597efa5718c6c9f342190c64a0b5b338 100644 (file)
@@ -13,7 +13,8 @@ def check_all(modname):
            "%s has no __all__ attribute" % modname)
     names = {}
     exec "from %s import *" % modname in names
-    del names["__builtins__"]
+    if names.has_key("__builtins__"):
+        del names["__builtins__"]
     keys = names.keys()
     keys.sort()
     all = list(sys.modules[modname].__all__) # in case it's a tuple