From: Just van Rossum Date: Wed, 31 Oct 2001 22:58:23 +0000 (+0000) Subject: Workaround for odd problem on my machine: without this I get a traceback X-Git-Tag: v2.2.1c1~930 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=67050d2d64558e46c63d4538b06653e7165a28c6;p=python Workaround for odd problem on my machine: without this I get a traceback if I hit enter instead of return upon file selection. --- diff --git a/Mac/Lib/macfsn.py b/Mac/Lib/macfsn.py index c4969034af..e7eeacd565 100644 --- a/Mac/Lib/macfsn.py +++ b/Mac/Lib/macfsn.py @@ -46,7 +46,11 @@ def _PromptGetFile(prompt, *typelist): good = 0 fss = macfs.FSSpec(':cancelled') else: - fss = rr.selection[0] + if rr.selection: + fss = rr.selection[0] + else: + fss = None + good = 0 ## if typehandle: ## typehandle.DisposeHandle() return fss, good