From 14269d91d14f9d6ddf79a44d9879bd796a86e2f3 Mon Sep 17 00:00:00 2001 From: Zachary Ware Date: Mon, 7 Nov 2016 13:29:07 -0600 Subject: Fix PC/VS9.0/build_ssl.py for recent OpenSSL --- PC/VS9.0/build_ssl.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/PC/VS9.0/build_ssl.py b/PC/VS9.0/build_ssl.py index 95e0e78..524b4bc 100644 --- a/PC/VS9.0/build_ssl.py +++ b/PC/VS9.0/build_ssl.py @@ -26,6 +26,7 @@ from __future__ import with_statement, print_function from __future__ import with_statement import os, sys, re, shutil +import subprocess # Find all "foo.exe" files on the PATH. def find_all_on_path(filename, extras = None): @@ -48,12 +49,12 @@ 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 + else: + return perl print("Can not find a suitable PERL:") if perls: print(" the following perl interpreters were found:") @@ -163,6 +164,8 @@ def main(): perl = find_working_perl(perls) if perl: print("Found a working perl at '%s'" % (perl,)) + # Set PERL for the makefile to find it + os.environ["PERL"] = perl else: print("No Perl installation was found. Existing Makefiles are used.") sys.stdout.flush() -- cgit v0.12