summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2015-05-23 19:15:57 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2015-05-23 19:15:57 (GMT)
commitc70908558d8ebcb6c280391a720a4a0c6c4bc56d (patch)
treed9d0128b21a4b9901d77cbd433cd5fb70619ee4e /Lib
parent19cfb57f5f0836b794653379169ff6e1c2c2e730 (diff)
downloadcpython-c70908558d8ebcb6c280391a720a4a0c6c4bc56d.zip
cpython-c70908558d8ebcb6c280391a720a4a0c6c4bc56d.tar.gz
cpython-c70908558d8ebcb6c280391a720a4a0c6c4bc56d.tar.bz2
Issue #23970: Fixes bdist_wininst not working on non-Windows platform.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/distutils/command/bdist_wininst.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/distutils/command/bdist_wininst.py b/Lib/distutils/command/bdist_wininst.py
index a3eff7e..0c0e2c1 100644
--- a/Lib/distutils/command/bdist_wininst.py
+++ b/Lib/distutils/command/bdist_wininst.py
@@ -331,8 +331,13 @@ class bdist_wininst(Command):
bv = 14.0
else:
# for current version - use authoritative check.
- from msvcrt import CRT_ASSEMBLY_VERSION
- bv = float('.'.join(CRT_ASSEMBLY_VERSION.split('.', 2)[:2]))
+ try:
+ from msvcrt import CRT_ASSEMBLY_VERSION
+ except ImportError:
+ # cross-building, so assume the latest version
+ bv = 14.0
+ else:
+ bv = float('.'.join(CRT_ASSEMBLY_VERSION.split('.', 2)[:2]))
# wininst-x.y.exe is in the same directory as this file