summaryrefslogtreecommitdiffstats
path: root/PCbuild
diff options
context:
space:
mode:
authorTim Golden <mail@timgolden.me.uk>2014-05-09 17:01:44 (GMT)
committerTim Golden <mail@timgolden.me.uk>2014-05-09 17:01:44 (GMT)
commitfaf4d9ca8b35cd300caf8c2cd949b6ae4437a42b (patch)
tree820c8d61ff6b9ceab36ba6d58bfd6cd30f403691 /PCbuild
parent6eaac13c92750afddebf22fc0a57e3f40e9d1a2f (diff)
parent9c18fcf16141558616ecf201e5eaac0e8f899a44 (diff)
downloadcpython-faf4d9ca8b35cd300caf8c2cd949b6ae4437a42b.zip
cpython-faf4d9ca8b35cd300caf8c2cd949b6ae4437a42b.tar.gz
cpython-faf4d9ca8b35cd300caf8c2cd949b6ae4437a42b.tar.bz2
Issue10752 Be more robust when finding a PERL interpreter to build OpenSSL. Initial patch by Gabi Davar
Diffstat (limited to 'PCbuild')
-rw-r--r--PCbuild/prepare_ssl.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/PCbuild/prepare_ssl.py b/PCbuild/prepare_ssl.py
index 7dc5365..f9f8c12 100644
--- a/PCbuild/prepare_ssl.py
+++ b/PCbuild/prepare_ssl.py
@@ -21,6 +21,7 @@ import os
import re
import sys
import shutil
+import subprocess
# Find all "foo.exe" files on the PATH.
def find_all_on_path(filename, extras = None):
@@ -43,22 +44,21 @@ def find_all_on_path(filename, extras = None):
# is available.
def find_working_perl(perls):
for perl in perls:
- fh = os.popen('"%s" -e "use Win32;"' % perl)
- fh.read()
- rc = fh.close()
- if rc:
+ try:
+ subprocess.check_output([perl, "-e", "use Win32;"])
+ except subprocess.CalledProcessError:
continue
- return perl
- print("Can not find a suitable PERL:")
+ else:
+ return perl
+
if perls:
- print(" the following perl interpreters were found:")
+ print("The following perl interpreters were found:")
for p in perls:
print(" ", p)
print(" None of these versions appear suitable for building OpenSSL")
else:
- print(" NO perl interpreters were found on this machine at all!")
+ print("NO perl interpreters were found on this machine at all!")
print(" Please install ActivePerl and ensure it appears on your path")
- return None
def create_makefile64(makefile, m32):
"""Create and fix makefile for 64bit