summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-03-21 11:23:41 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-03-21 11:23:41 (GMT)
commit0f71f4415603d36e0fabec812f93dc80547466b3 (patch)
tree8699f6f046f71d058bc0142df798dbc796850e3a /Lib/idlelib
parent7941736ddb87baeb0771cdfd038de786cdff9009 (diff)
downloadcpython-0f71f4415603d36e0fabec812f93dc80547466b3.zip
cpython-0f71f4415603d36e0fabec812f93dc80547466b3.tar.gz
cpython-0f71f4415603d36e0fabec812f93dc80547466b3.tar.bz2
#3573: idle now doesn't hungs if launched as: idle -e <directory>
Patch by Guilherme Polo.
Diffstat (limited to 'Lib/idlelib')
-rw-r--r--Lib/idlelib/NEWS.txt7
-rw-r--r--Lib/idlelib/PyShell.py6
2 files changed, 11 insertions, 2 deletions
diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
index 0a4f98e..4482be2 100644
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -1,3 +1,10 @@
+What's New in IDLE 3.2.3?
+=========================
+
+- Issue #3573: IDLE hangs when passing invalid command line args
+ (directory(ies) instead of file(s)).
+
+
What's New in IDLE 3.2.1?
=========================
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
index 6bf0a8c..74a37db 100644
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -1389,8 +1389,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: