projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
638c722
)
uhh. __builtins__ is a module in __main__ and a dict elsewhere
author
Benjamin Peterson
<benjamin@python.org>
Tue, 29 Jul 2008 15:53:12 +0000
(15:53 +0000)
committer
Benjamin Peterson
<benjamin@python.org>
Tue, 29 Jul 2008 15:53:12 +0000
(15:53 +0000)
Lib/doctest.py
patch
|
blob
|
history
diff --git
a/Lib/doctest.py
b/Lib/doctest.py
index 64a0375da31e2b4c68b9f49bc633a252c493c662..e2b595ea51fb89aa708480a1dff6d35254099987 100644
(file)
--- 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