]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #18081: Back out temporary changeset, 2a9e1eb3719c, to merge new patch.
authorTerry Jan Reedy <tjreedy@udel.edu>
Sat, 29 Jun 2013 03:47:40 +0000 (23:47 -0400)
committerTerry Jan Reedy <tjreedy@udel.edu>
Sat, 29 Jun 2013 03:47:40 +0000 (23:47 -0400)
If buildbots run before next push, test_logging will (temporarily) fail.

Lib/idlelib/PyShell.py
Lib/idlelib/run.py

index cde389ad009cbe3d6b45e5e2f12fbd111d5730cb..d8a5cd24331bc2b829ca4da05e9c3a1506a563d2 100644 (file)
@@ -61,6 +61,7 @@ else:
                                               lineno, line=line))
         except OSError:
             pass  ## file (probably __stderr__) is invalid, warning dropped.
+    warnings.showwarning = idle_showwarning
     def idle_formatwarning(message, category, filename, lineno, line=None):
         """Format warnings the IDLE way"""
         s = "\nWarning (from warnings module):\n"
@@ -72,6 +73,7 @@ else:
             s += "    %s\n" % line
         s += "%s: %s\n>>> " % (category.__name__, message)
         return s
+    warnings.formatwarning = idle_formatwarning
 
 def extended_linecache_checkcache(filename=None,
                                   orig_checkcache=linecache.checkcache):
@@ -1423,9 +1425,6 @@ echo "import sys; print(sys.argv)" | idle - "foobar"
 def main():
     global flist, root, use_subprocess
 
-    warnings.showwarning = idle_showwarning
-    warnings.formatwarning = idle_formatwarning
-
     use_subprocess = True
     enable_shell = False
     enable_edit = False
index 74c1b8947a0d0b157505fa4208b8f83d3b96a18c..15f44720dd74b77f0dfd22d17e440870968ebc33 100644 (file)
@@ -40,6 +40,7 @@ else:
             s += "    %s\n" % line
         s += "%s: %s\n" % (category.__name__, message)
         return s
+    warnings.formatwarning = idle_formatwarning_subproc
 
 
 tcl = tkinter.Tcl()
@@ -81,9 +82,6 @@ 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: