summaryrefslogtreecommitdiffstats
path: root/QMTest/TestSCons.py
diff options
context:
space:
mode:
Diffstat (limited to 'QMTest/TestSCons.py')
-rw-r--r--QMTest/TestSCons.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/QMTest/TestSCons.py b/QMTest/TestSCons.py
index c5180d8..a35bf8d 100644
--- a/QMTest/TestSCons.py
+++ b/QMTest/TestSCons.py
@@ -100,12 +100,19 @@ def gccFortranLibs():
a more reliable way, but using popen3 is relatively efficient."""
libs = ['g2c']
+ cmd = 'gcc -v'
try:
- import popen2
- stderr = popen2.popen3('gcc -v')[2]
- except OSError:
- return libs
+ import subprocess
+ except ImportError:
+ try:
+ import popen2
+ stderr = popen2.popen3(cmd)[2]
+ except OSError:
+ return libs
+ else:
+ p = subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE)
+ stderr = p.stderr
for l in stderr.readlines():
list = string.split(l)