diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2002-03-29 21:19:37 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2002-03-29 21:19:37 (GMT) |
commit | 32f782c03c5e47b5822ce9387176e38123475834 (patch) | |
tree | ec238100073d47b29ffafb32f777fb178356365c /Mac/Lib | |
parent | d21c9f48faec41614f99eb95c775cf0ff3fc532f (diff) | |
download | cpython-32f782c03c5e47b5822ce9387176e38123475834.zip cpython-32f782c03c5e47b5822ce9387176e38123475834.tar.gz cpython-32f782c03c5e47b5822ce9387176e38123475834.tar.bz2 |
Don't attempt to create a dummy fsspec if the user cancelled out, just
return None.
For now, if the user asks for TEXT files files without type are also
accepted. But it is time to phase out StandardGetFile and friends, really.
Diffstat (limited to 'Mac/Lib')
-rw-r--r-- | Mac/Lib/macfsn.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Mac/Lib/macfsn.py b/Mac/Lib/macfsn.py index e7eeacd..8f3203c 100644 --- a/Mac/Lib/macfsn.py +++ b/Mac/Lib/macfsn.py @@ -12,6 +12,9 @@ _curfolder = None _movablemodal = 1 def _mktypelist(typelist): + # Workaround for OSX typeless files: + if 'TEXT' in typelist and not '\0\0\0\0' in typelist: + typelist = typelist + ('\0\0\0\0',) if not typelist: return None data = 'Pyth' + struct.pack("hh", 0, len(typelist)) @@ -44,7 +47,7 @@ def _PromptGetFile(prompt, *typelist): if arg[0] != -128: # userCancelledErr raise Nav.error, arg good = 0 - fss = macfs.FSSpec(':cancelled') + fss = None else: if rr.selection: fss = rr.selection[0] @@ -74,7 +77,7 @@ def _StandardPutFile(prompt, default=None): if arg[0] != -128: # userCancelledErr raise Nav.error, arg good = 0 - fss = macfs.FSSpec(':cancelled') + fss = None else: fss = rr.selection[0] return fss, good @@ -115,7 +118,7 @@ def _GetDirectory(prompt=None): if arg[0] != -128: # userCancelledErr raise Nav.error, arg good = 0 - fss = macfs.FSSpec(':cancelled') + fss = None else: fss = rr.selection[0] return fss, good |