Skip to content

Commit 912bad7

Browse files
committed
Issue #18081: Back out temporary changeset, 2a9e1eb3719c, to merge new patch.
If buildbots run before next push, test_logging will (temporarily) fail.
1 parent e256346 commit 912bad7

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

Lib/idlelib/PyShell.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def idle_showwarning(message, category, filename, lineno,
6161
lineno, line=line))
6262
except OSError:
6363
pass ## file (probably __stderr__) is invalid, warning dropped.
64+
warnings.showwarning = idle_showwarning
6465
def idle_formatwarning(message, category, filename, lineno, line=None):
6566
"""Format warnings the IDLE way"""
6667
s = "\nWarning (from warnings module):\n"
@@ -72,6 +73,7 @@ def idle_formatwarning(message, category, filename, lineno, line=None):
7273
s += " %s\n" % line
7374
s += "%s: %s\n>>> " % (category.__name__, message)
7475
return s
76+
warnings.formatwarning = idle_formatwarning
7577

7678
def extended_linecache_checkcache(filename=None,
7779
orig_checkcache=linecache.checkcache):
@@ -1423,9 +1425,6 @@ def close(self):
14231425
def main():
14241426
global flist, root, use_subprocess
14251427

1426-
warnings.showwarning = idle_showwarning
1427-
warnings.formatwarning = idle_formatwarning
1428-
14291428
use_subprocess = True
14301429
enable_shell = False
14311430
enable_edit = False

Lib/idlelib/run.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def idle_formatwarning_subproc(message, category, filename, lineno,
4040
s += " %s\n" % line
4141
s += "%s: %s\n" % (category.__name__, message)
4242
return s
43+
warnings.formatwarning = idle_formatwarning_subproc
4344

4445

4546
tcl = tkinter.Tcl()
@@ -81,9 +82,6 @@ def main(del_exitfunc=False):
8182
global exit_now
8283
global quitting
8384
global no_exitfunc
84-
85-
warnings.formatwarning = idle_formatwarning_subproc
86-
8785
no_exitfunc = del_exitfunc
8886
#time.sleep(15) # test subprocess not responding
8987
try:

0 commit comments

Comments
 (0)