From: Skip Montanaro Date: Wed, 7 Feb 2001 22:46:55 +0000 (+0000) Subject: test for presence of __builtins__ in names before deleting it, enabling this X-Git-Tag: v2.1b1~494 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cc012e92b21fbd8476bbaa8d4aa91b7e78111182;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/test/test___all__.py b/Lib/test/test___all__.py index 853a816edff1..a3ae9564597e 100644 --- a/Lib/test/test___all__.py +++ b/Lib/test/test___all__.py @@ -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