Skip to content

Commit

Permalink
bpo-35952: Fix test.pythoninfo when the compiler is missing (GH-13007)
Browse files Browse the repository at this point in the history
  • Loading branch information
xdegaye authored and vstinner committed Apr 29, 2019
1 parent 843bf42 commit a86e064
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Lib/test/pythoninfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 +571,17 @@ def collect_cc(info_add):
except ImportError:
args = CC.split()
args.append('--version')
proc = subprocess.Popen(args,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True)
try:
proc = subprocess.Popen(args,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
universal_newlines=True)
except OSError:
# Cannot run the compiler, for example when Python has been
# cross-compiled and installed on the target platform where the
# compiler is missing.
return

stdout = proc.communicate()[0]
if proc.returncode:
# CC --version failed: ignore error
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix pythoninfo when the compiler is missing.

0 comments on commit a86e064

Please sign in to comment.