diff options
author | Steve Dower <steve.dower@microsoft.com> | 2015-09-23 00:35:24 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2015-09-23 00:35:24 (GMT) |
commit | 8f278f166255bb02dbee21e98689bb2fed58b3df (patch) | |
tree | ddf82d9a59b19aed103baccdae4fb2a5cc47cc1d | |
parent | 64a3387d69ca5a6a9c33a78310c2dfa7601d8d7c (diff) | |
download | cpython-8f278f166255bb02dbee21e98689bb2fed58b3df.zip cpython-8f278f166255bb02dbee21e98689bb2fed58b3df.tar.gz cpython-8f278f166255bb02dbee21e98689bb2fed58b3df.tar.bz2 |
Handle calls to win32_ver from non-Windows platform
-rwxr-xr-x | Lib/platform.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/platform.py b/Lib/platform.py index 6eb456b..ad425a1 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -546,7 +546,10 @@ def _get_real_winver(maj, min, build): return maj, min, build def win32_ver(release='', version='', csd='', ptype=''): - from sys import getwindowsversion + try: + from sys import getwindowsversion + except ImportError: + return release, version, csd, ptype try: from winreg import OpenKeyEx, QueryValueEx, CloseKey, HKEY_LOCAL_MACHINE except ImportError: |