Skip to content

Commit

Permalink
Patch to allow for 2 as a minor version (!)
Browse files Browse the repository at this point in the history
The float representation of e.g. 14.2 is not exact, leading to a minor
version number of int(1.999999) == 1 in the original code.
  • Loading branch information
matthew-brett authored and charris committed Nov 3, 2021
1 parent 2b1485e commit efda582
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions numpy/distutils/mingw32ccompiler.py
Expand Up @@ -647,11 +647,9 @@ def generate_manifest(config):
if msver is not None:
if msver >= 8:
check_embedded_msvcr_match_linked(msver)
ma = int(msver)
mi = int((msver - ma) * 10)
ma_str, mi_str = str(msver).split('.')
# Write the manifest file
manxml = msvc_manifest_xml(ma, mi)
man = open(manifest_name(config), "w")
config.temp_files.append(manifest_name(config))
man.write(manxml)
man.close()
manxml = msvc_manifest_xml(int(ma_str), int(mi_str))
with open(manifest_name(config), "w") as man:
config.temp_files.append(manifest_name(config))
man.write(manxml)

0 comments on commit efda582

Please sign in to comment.