]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#3573: idle now doesn't hungs if launched as: idle -e <directory>
authorAndrew Svetlov <andrew.svetlov@gmail.com>
Tue, 20 Mar 2012 21:03:26 +0000 (23:03 +0200)
committerAndrew Svetlov <andrew.svetlov@gmail.com>
Tue, 20 Mar 2012 21:03:26 +0000 (23:03 +0200)
Patch by Guilherme Polo.

Lib/idlelib/PyShell.py
Misc/NEWS

index 6b75a8d4d0c414088df5a087425d867fed975368..d7edce501f49430c7b778fc0860f0187bc7f97d1 100644 (file)
@@ -1403,8 +1403,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 94f3fc85540da0bac10730a5b25eac6f4dde2ca2..fe37f1038d776275420e40f08dda77e7419f3d95 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,11 @@ What's New in Python 3.3.0 Alpha 2?
 Core and Builtins
 -----------------
 
+- Issue #3573: IDLE hangs when passing invalid command line args
+  (directory(ies) instead of file(s))
+
+  Thanks to Guilherme Polo for patch and to Roger Serwy for review.
+
 - Issue #1683368: object.__new__ and object.__init__ raise a TypeError if they
   are passed arguments and their complementary method is not overridden.