From: Andrew Svetlov Date: Tue, 20 Mar 2012 21:03:26 +0000 (+0200) Subject: #3573: idle now doesn't hungs if launched as: idle -e X-Git-Tag: v3.3.0a2~103 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6b6e437626e94ad5ef3233ea9129c48957f1a41b;p=thirdparty%2FPython%2Fcpython.git #3573: idle now doesn't hungs if launched as: idle -e Patch by Guilherme Polo. --- diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py index 6b75a8d4d0c4..d7edce501f49 100644 --- a/Lib/idlelib/PyShell.py +++ b/Lib/idlelib/PyShell.py @@ -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: diff --git a/Misc/NEWS b/Misc/NEWS index 94f3fc85540d..fe37f1038d77 100644 --- 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.