]> granicus.if.org Git - python/commitdiff
Workaround for odd problem on my machine: without this I get a traceback
authorJust van Rossum <just@letterror.com>
Wed, 31 Oct 2001 22:58:23 +0000 (22:58 +0000)
committerJust van Rossum <just@letterror.com>
Wed, 31 Oct 2001 22:58:23 +0000 (22:58 +0000)
if I hit enter instead of return upon file selection.

Mac/Lib/macfsn.py

index c4969034af76a308b75ffef16cee237ff4aab02c..e7eeacd565ccc7fe26b5e3917282a47cfea26f41 100644 (file)
@@ -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