summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2015-09-23 00:35:24 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2015-09-23 00:35:24 (GMT)
commit8f278f166255bb02dbee21e98689bb2fed58b3df (patch)
treeddf82d9a59b19aed103baccdae4fb2a5cc47cc1d
parent64a3387d69ca5a6a9c33a78310c2dfa7601d8d7c (diff)
downloadcpython-8f278f166255bb02dbee21e98689bb2fed58b3df.zip
cpython-8f278f166255bb02dbee21e98689bb2fed58b3df.tar.gz
cpython-8f278f166255bb02dbee21e98689bb2fed58b3df.tar.bz2
Handle calls to win32_ver from non-Windows platform
-rwxr-xr-xLib/platform.py5
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: