summaryrefslogtreecommitdiffstats
path: root/Lib/platform.py
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)
commite20c2a6af48403db3bf843917007f5eaba594d1b (patch)
treebfcddfd2bdb23cb541ee743b92e04a4cab1e3d9b /Lib/platform.py
parent044cde52f821c612b2cbdd9e3cce60a4cfb97a1a (diff)
downloadcpython-e20c2a6af48403db3bf843917007f5eaba594d1b.zip
cpython-e20c2a6af48403db3bf843917007f5eaba594d1b.tar.gz
cpython-e20c2a6af48403db3bf843917007f5eaba594d1b.tar.bz2
Handle calls to win32_ver from non-Windows platform
Diffstat (limited to 'Lib/platform.py')
-rwxr-xr-xLib/platform.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/platform.py b/Lib/platform.py
index c58c3fd..3dbdfe0 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -622,7 +622,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: