diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-07-29 15:53:12 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-07-29 15:53:12 (GMT) |
commit | f63e343c39902e05a947320bb843a95e5b3d4535 (patch) | |
tree | e000553b196ef276705a7f237837a5b3701beb16 /Lib/doctest.py | |
parent | 638c722228940d62662f2337ed4c47c30afed37a (diff) | |
download | cpython-f63e343c39902e05a947320bb843a95e5b3d4535.zip cpython-f63e343c39902e05a947320bb843a95e5b3d4535.tar.gz cpython-f63e343c39902e05a947320bb843a95e5b3d4535.tar.bz2 |
uhh. __builtins__ is a module in __main__ and a dict elsewhere
Diffstat (limited to 'Lib/doctest.py')
-rw-r--r-- | Lib/doctest.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py index 64a0375..e2b595e 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -1360,7 +1360,10 @@ class DocTestRunner: linecache.getlines = self.save_linecache_getlines if clear_globs: test.globs.clear() - __builtins__['_'] = None + if __name__ == "__main__": + __builtins__._ = None + else: + __builtins__['_'] = None #///////////////////////////////////////////////////////////////// # Summarization |