summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/pythoninfo.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py
index 19f274a..5809566 100644
--- a/Lib/test/pythoninfo.py
+++ b/Lib/test/pythoninfo.py
@@ -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