[Python-checkins] r65730 - sandbox/trunk/ttk-gsoc/src/idlelib/PyShell.py

guilherme.polo python-checkins at python.org
Sun Aug 17 01:25:16 CEST 2008


Author: guilherme.polo
Date: Sun Aug 17 01:25:16 2008
New Revision: 65730

Log:
It is possible to hang IDLE if user passes a directory, and only that, as a command line argument. This fixes it.

Modified:
   sandbox/trunk/ttk-gsoc/src/idlelib/PyShell.py

Modified: sandbox/trunk/ttk-gsoc/src/idlelib/PyShell.py
==============================================================================
--- sandbox/trunk/ttk-gsoc/src/idlelib/PyShell.py	(original)
+++ sandbox/trunk/ttk-gsoc/src/idlelib/PyShell.py	Sun Aug 17 01:25:16 2008
@@ -1416,8 +1416,9 @@
 
     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:
+                    args.remove(filename)
             if not args:
                 flist.new()
     if enable_shell:


More information about the Python-checkins mailing list