]> granicus.if.org Git - python/commitdiff
#4383: UnboundLocalError when IDLE cannot connect to its subprocess.
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>
Fri, 21 Nov 2008 23:08:09 +0000 (23:08 +0000)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>
Fri, 21 Nov 2008 23:08:09 +0000 (23:08 +0000)
Python 3.0 clears the exception variable upon exit of the "except:" clause,
and the displaying code fails miserably.

Reviewed by Benjamin.

Lib/idlelib/run.py
Misc/NEWS

index 806456a3a84ca86cfecb2d32f2eb6c8d0c12092c..20770b68d032d6450fcc421b6a84a0ef034ddab2 100644 (file)
@@ -119,10 +119,11 @@ def manage_socket(address):
         except socket.error as err:
             print("IDLE Subprocess: socket error: " + err.args[1] +
                   ", retrying....", file=sys.__stderr__)
+            socket_error = err
     else:
-        print("IDLE Subprocess: Connection to "\
-                               "IDLE GUI failed, exiting.", file=sys.__stderr__)
-        show_socket_error(err, address)
+        print("IDLE Subprocess: Connection to "
+              "IDLE GUI failed, exiting.", file=sys.__stderr__)
+        show_socket_error(socket_error, address)
         global exit_now
         exit_now = True
         return
index 1de10742140f44eacbd1f09d7b5f81350fce657e..1e61e549dae1548b95f3a5240fea0e4aa7c473bc 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -15,6 +15,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #4383: When IDLE cannot make the connection to its subprocess, it would
+  fail to properly display the error message.
+
 
 What's New in Python 3.0 release candidate 3?
 =============================================