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

Commit

Permalink
Hide stderr in case -dumpfullversion is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
wence- committed Oct 9, 2017
1 parent 13df304 commit 268d1a9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pyop2/compilation.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,13 @@ def sniff_compiler_version(cc):
if compiler in ["gcc", "icc"]:
try:
# gcc-7 series only spits out patch level on dumpfullversion.
ver = subprocess.check_output([cc, "-dumpfullversion"]).decode("utf-8")
ver = subprocess.check_output([cc, "-dumpfullversion"],
stderr=subprocess.DEVNULL).decode("utf-8")
ver = version.StrictVersion(ver.strip())
except subprocess.CalledProcessError:
try:
ver = subprocess.check_output([cc, "-dumpversion"]).decode("utf-8")
ver = subprocess.check_output([cc, "-dumpversion"],
stderr=subprocess.DEVNULL).decode("utf-8")
ver = version.StrictVersion(ver.strip())
except (subprocess.CalledProcessError, UnicodeDecodeError):
pass
Expand Down

0 comments on commit 268d1a9

Please sign in to comment.