- Timestamp:
- Aug 23, 2012, 1:25:28 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga_parallel/pypar_extras/setup.py
r8516 r8533 50 50 51 51 def _run_command(cmd): 52 out_file, in_file, err_file = popen2.popen3(cmd) 53 output = out_file.read() + err_file.read() 54 out_file.close() 55 in_file.close() 56 err_file.close() 57 # need this hack to get the exit status 52 import subprocess 53 58 54 print 'running ' + cmd 59 out_file = os.popen(cmd) 60 if out_file.close(): 61 # close returns exit status of command. 62 return '' 63 else: 64 # no errors, out_file.close() returns None. 65 return output 55 try: 56 output = subprocess.check_output(cmd, shell=True) 57 except: 58 output = '' 59 60 return output 61 62 66 63 67 64 … … 71 68 # LAM/OPENMPI/MPICH2 72 69 output = _run_command('mpicc -show') 70 71 73 72 if output: 74 73 return output
Note: See TracChangeset
for help on using the changeset viewer.