]> granicus.if.org Git - python/commitdiff
#3573: idle now doesn't hungs if launched as: idle -e <directory>
authorAndrew Svetlov <andrew.svetlov@gmail.com>
Wed, 21 Mar 2012 11:35:08 +0000 (13:35 +0200)
committerAndrew Svetlov <andrew.svetlov@gmail.com>
Wed, 21 Mar 2012 11:35:08 +0000 (13:35 +0200)
Patch by Guilherme Polo.

Lib/idlelib/NEWS.txt
Lib/idlelib/PyShell.py
Misc/NEWS

index 46ef3cb658844ceb49e09ea3d5df75f0d77dfc93..205b9f3b48e8d503dd67327d4b1bd7bee6565f8d 100644 (file)
@@ -1,3 +1,10 @@
+What's New in IDLE 2.7.3?
+=======================
+
+- Issue #3573: IDLE hangs when passing invalid command line args
+  (directory(ies) instead of file(s)).
+
+
 What's New in IDLE 2.7.2?
 =======================
 
index 895d7dac09bf022730b1659804705e7399b281fa..eeb33e1c75088fae6cec3cc577f46a901fafc4bf 100644 (file)
@@ -1412,8 +1412,10 @@ def main():
 
     if enable_edit:
         if not (cmd or script):
-            for filename in args:
-                flist.open(filename)
+            for filename in args[:]:
+                if flist.open(filename) is None:
+                    # filename is a directory actually, disconsider it
+                    args.remove(filename)
             if not args:
                 flist.new()
     if enable_shell:
index 0b3668fe39fba088f7bec5519b045e1be59aed65..65b5c1723f78fc23f000191f58c28bf764f6ffad 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -27,6 +27,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #3573: IDLE hangs when passing invalid command line args
+  (directory(ies) instead of file(s)) (Patch by Guilherme Polo)
+
 - Issue #13694: asynchronous connect in asyncore.dispatcher does not set addr
   attribute.