From: Andrew Svetlov Date: Wed, 21 Mar 2012 11:35:08 +0000 (+0200) Subject: #3573: idle now doesn't hungs if launched as: idle -e X-Git-Tag: v2.7.4rc1~954^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7c010ee00cc0bfb859c326d9a78bd8dd2bf92246;p=python #3573: idle now doesn't hungs if launched as: idle -e Patch by Guilherme Polo. --- diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt index 46ef3cb658..205b9f3b48 100644 --- a/Lib/idlelib/NEWS.txt +++ b/Lib/idlelib/NEWS.txt @@ -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? ======================= diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index 895d7dac09..eeb33e1c75 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -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: diff --git a/Misc/NEWS b/Misc/NEWS index 0b3668fe39..65b5c1723f 100644 --- 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.