diff options
author | Phil Ruffwind <rf@rufflewind.com> | 2015-05-28 14:14:49 +0200 |
---|---|---|
committer | Thomas Miedema <thomasmiedema@gmail.com> | 2015-05-28 14:15:06 +0200 |
commit | ef9046601b8616106878529884ce1e9ae645f9ed (patch) | |
tree | 58989dde0abfdb3a780fb8921cb9ac29816cb6f8 /testsuite/config | |
parent | c5911479f295242e16e396eb5d1369f2e4ce8de0 (diff) | |
download | haskell-ef9046601b8616106878529884ce1e9ae645f9ed.tar.gz |
Testdriver: don't use os.popen in config/ghc
Rewrite config/ghc to use getStdout (which use subprocess.Popen) instead
of os.popen, which is deprecated; this also avoids the use of shell
Also:
* Move getStdout to driver/testutil.py so both config/ghc and
driver/runtests.py can use it
* Remove support for Python below 2.4, which doesn't have subprocess
Reviewed By: thomie
Differential Revision: https://phabricator.haskell.org/D908
Diffstat (limited to 'testsuite/config')
-rw-r--r-- | testsuite/config/ghc | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/testsuite/config/ghc b/testsuite/config/ghc index 5e4bda2e89..a1b1ccc16b 100644 --- a/testsuite/config/ghc +++ b/testsuite/config/ghc @@ -1,5 +1,5 @@ -import os import re +import subprocess # Testsuite configuration setup for GHC # @@ -159,16 +159,11 @@ llvm_ways = [x[0] for x in config.way_flags('dummy_name').items() if '-fflvm' in x[1]] def get_compiler_info(): -# This should really not go through the shell - h = os.popen(config.compiler + ' --info', 'r') - s = h.read() + s = getStdout([config.compiler, '--info']).decode('utf8') s = re.sub('[\r\n]', '', s) - h.close() compilerInfoDict = dict(eval(s)) - h = os.popen(config.compiler + ' +RTS --info', 'r') - s = h.read() + s = getStdout([config.compiler, '+RTS', '--info']).decode('utf8') s = re.sub('[\r\n]', '', s) - h.close() rtsInfoDict = dict(eval(s)) # We use a '/'-separated path for libdir, even on Windows |