]> granicus.if.org Git - python/commitdiff
Issue #23970: Fixes bdist_wininst not working on non-Windows platform.
authorSteve Dower <steve.dower@microsoft.com>
Sat, 23 May 2015 19:15:57 +0000 (12:15 -0700)
committerSteve Dower <steve.dower@microsoft.com>
Sat, 23 May 2015 19:15:57 +0000 (12:15 -0700)
Lib/distutils/command/bdist_wininst.py

index a3eff7e7cf9696efc9e69b13aa4062bfb887360a..0c0e2c1a26491c6fa360b77edc3ed3177bdac9c8 100644 (file)
@@ -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