From: Amaury Forgeot d'Arc Date: Fri, 21 Nov 2008 23:08:09 +0000 (+0000) Subject: #4383: UnboundLocalError when IDLE cannot connect to its subprocess. X-Git-Tag: v3.0~86 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=efae8c499f522547b9e73afde8821b0a1b1bf015;p=thirdparty%2FPython%2Fcpython.git #4383: UnboundLocalError when IDLE cannot connect to its subprocess. Python 3.0 clears the exception variable upon exit of the "except:" clause, and the displaying code fails miserably. Reviewed by Benjamin. --- diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index 806456a3a84c..20770b68d032 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -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 diff --git a/Misc/NEWS b/Misc/NEWS index 1de10742140f..1e61e549dae1 100644 --- 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? =============================================