summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/doctest.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py
index e2b595e..e8babd2 100644
--- a/Lib/doctest.py
+++ b/Lib/doctest.py
@@ -1360,10 +1360,8 @@ class DocTestRunner:
linecache.getlines = self.save_linecache_getlines
if clear_globs:
test.globs.clear()
- if __name__ == "__main__":
- __builtins__._ = None
- else:
- __builtins__['_'] = None
+ import builtins
+ builtins._ = None
#/////////////////////////////////////////////////////////////////
# Summarization