From: Kurt B. Kaiser Date: Sat, 4 Apr 2009 20:13:23 +0000 (+0000) Subject: Merged revisions 71023 via svnmerge from X-Git-Tag: v3.1a2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e67842aedc701ae53ffee783b38fcbf56c022296;p=thirdparty%2FPython%2Fcpython.git Merged revisions 71023 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r71023 | kurt.kaiser | 2009-04-01 22:44:54 -0400 (Wed, 01 Apr 2009) | 3 lines Remove port spec from run.py and fix bug where subprocess fails to extract port from command line when warnings are present. ........ --- diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 6ff8e6f9a2c1..87acd5f447e6 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -3,6 +3,9 @@ What's New in IDLE 3.1a1? *Release date: XX-XXX-XXXX* +- Remove port spec from run.py and fix bug where subprocess fails to + extract port from command line when warnings are present. + - Issue #4815: Offer conversion to UTF-8 if source files have no encoding declaration and are not encoded in UTF-8. diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index 28b7bc0bca23..6659ee725d1a 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -67,10 +67,13 @@ def main(del_exitfunc=False): global quitting global no_exitfunc no_exitfunc = del_exitfunc - port = 8833 #time.sleep(15) # test subprocess not responding - if sys.argv[1:]: - port = int(sys.argv[1]) + try: + assert(len(sys.argv) > 1) + port = int(sys.argv[-1]) + except: + print>>sys.stderr, "IDLE Subprocess: no IP port passed in sys.argv." + return sys.argv[:] = [""] sockthread = threading.Thread(target=manage_socket, name='SockThread',