summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/run.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-06-24 22:17:37 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-06-24 22:17:37 (GMT)
commitb28a375f2f4724c129e8683f548c8f1477e00a68 (patch)
tree2db689a322b090dcc348863f2e632d1dfdcf86e7 /Lib/idlelib/run.py
parent7660b880a583442af8ad9d5c91ce608abd4b9654 (diff)
downloadcpython-b28a375f2f4724c129e8683f548c8f1477e00a68.zip
cpython-b28a375f2f4724c129e8683f548c8f1477e00a68.tar.gz
cpython-b28a375f2f4724c129e8683f548c8f1477e00a68.tar.bz2
Issue #18081: Workaround "./python -m test_idle test_logging" failure
"import idlelib" should not install hooks on the warning modules, hooks should only be installed when IDLE is started.
Diffstat (limited to 'Lib/idlelib/run.py')
-rw-r--r--Lib/idlelib/run.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
index 15f4472..74c1b89 100644
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -40,7 +40,6 @@ else:
s += " %s\n" % line
s += "%s: %s\n" % (category.__name__, message)
return s
- warnings.formatwarning = idle_formatwarning_subproc
tcl = tkinter.Tcl()
@@ -82,6 +81,9 @@ def main(del_exitfunc=False):
global exit_now
global quitting
global no_exitfunc
+
+ warnings.formatwarning = idle_formatwarning_subproc
+
no_exitfunc = del_exitfunc
#time.sleep(15) # test subprocess not responding
try: