]> granicus.if.org Git - python/commitdiff
Remove port spec from run.py and fix bug where
authorKurt B. Kaiser <kbk@shore.net>
Thu, 2 Apr 2009 02:44:54 +0000 (02:44 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Thu, 2 Apr 2009 02:44:54 +0000 (02:44 +0000)
subprocess fails to extract port from command line
when warnings are present.

Lib/idlelib/NEWS.txt
Lib/idlelib/run.py

index 6f912e8bad99ac289877d704e58e31177d692852..b3095e6ad3bbc633c360b4791f0e421d787429e6 100644 (file)
@@ -3,8 +3,11 @@ What's New in IDLE 2.7a0?
 
 *Release date: XX-XXX-2009*
 
+- Remove port spec from run.py and fix bug where subprocess fails to
+  extract port from command line when warnings are present.
+
 - Tk 8.5 Text widget requires 'wordprocessor' tabstyle attr to handle
-  mixed space/tab properly. Issue 5120, patch by Guilherme Polo.
+  mixed space/tab properly. Issue 5129, patch by Guilherme Polo.
   
 - Issue #3549: On MacOS the preferences menu was not present
 
index abe94abc8b9c44e9ba6ea1a25d484b8e209954bb..2d5c5edaaa7de51d32d86a94253d2ef4f02459f8 100644 (file)
@@ -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',