Skip to content

Commit

Permalink
Integer parse fix for visual studio generator
Browse files Browse the repository at this point in the history
  • Loading branch information
rwols committed Jul 15, 2017
1 parent 5dad57b commit 3237237
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions generators/windows/Visual_Studio.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,17 @@ def __repr__(self):
vs_versions = [15.0, 14.1, 14.0, 13.0, 12.0, 11.0, 10.0]
for version in vs_versions:
if version in years:
if version.is_integer():
result += ' %i %i' % (int(version), years[version])
else:
result += ' %0.1f %i' % (version, years[version])
ok = True
break
if isinstance(version, int):
result += ' %i %i' % (version, years[version])
ok = True
break
elif isinstance(version, float):
if version.is_integer():
result += ' %i %i' % (int(version), years[version])
else:
result += ' %0.1f %i' % (version, years[version])
ok = True
break
if not ok:
raise Exception('Could not determine Visual Studio version!')
if self.target_architecture:
Expand Down

0 comments on commit 3237237

Please sign in to comment.