diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2003-08-11 11:08:49 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2003-08-11 11:08:49 (GMT) |
commit | a290e3d7c6c15454496d5a8bb163af61f99f52c0 (patch) | |
tree | 77362ab914ba27e0cd0f5992d3b0e1418612cdcf /Lib | |
parent | 5187a3bcdb565c30fc998078a3fcc3293f963ffd (diff) | |
download | cpython-a290e3d7c6c15454496d5a8bb163af61f99f52c0.zip cpython-a290e3d7c6c15454496d5a8bb163af61f99f52c0.tar.gz cpython-a290e3d7c6c15454496d5a8bb163af61f99f52c0.tar.bz2 |
Bug fix for #780461: 'sysu' gestalt selector is meaningless on MacOSX,
but attempting to get it resulted in a crash. Fixed. Backport candidate.
Diffstat (limited to 'Lib')
-rwxr-xr-x | Lib/platform.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/platform.py b/Lib/platform.py index 9404b5c..1547e12 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -525,12 +525,13 @@ def win32_ver(release='',version='',csd='',ptype=''): def _mac_ver_lookup(selectors,default=None): from gestalt import gestalt + import MacOS l = [] append = l.append for selector in selectors: try: append(gestalt(selector)) - except RuntimeError: + except (RuntimeError, MacOS.Error): append(default) return l @@ -557,6 +558,7 @@ def mac_ver(release='',versioninfo=('','',''),machine=''): # Check whether the version info module is available try: import gestalt + import MacOS except ImportError: return release,versioninfo,machine # Get the infos |