diff options
author | Steve Dower <steve.dower@microsoft.com> | 2015-05-23 19:15:57 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2015-05-23 19:15:57 (GMT) |
commit | c70908558d8ebcb6c280391a720a4a0c6c4bc56d (patch) | |
tree | d9d0128b21a4b9901d77cbd433cd5fb70619ee4e /Lib/distutils/command/bdist_wininst.py | |
parent | 19cfb57f5f0836b794653379169ff6e1c2c2e730 (diff) | |
download | cpython-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/distutils/command/bdist_wininst.py')
-rw-r--r-- | Lib/distutils/command/bdist_wininst.py | 9 |
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 |