Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
compilation: Fix for single digit versions
Browse files Browse the repository at this point in the history
  • Loading branch information
wence- committed Apr 17, 2019
1 parent d109b46 commit ba54ab7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pyop2/compilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ def sniff_compiler_version(cc):
try:
ver = subprocess.check_output([cc, "-dumpversion"],
stderr=subprocess.DEVNULL).decode("utf-8")
ver = version.StrictVersion(ver.strip())
try:
ver = version.StrictVersion(ver.strip())
except ValueError:
# A sole digit, e.g. 7, results in a ValueError, so
# append a "do-nothing, but make it work" string.
ver = version.StrictVersion(ver.strip() + ".0")
if compiler == "gcc" and ver >= version.StrictVersion("7.0"):
try:
# gcc-7 series only spits out patch level on dumpfullversion.
Expand Down

0 comments on commit ba54ab7

Please sign in to comment.