Ignore:
Timestamp:
Aug 23, 2012, 1:25:28 PM (13 years ago)
Author:
steve
Message:

A few enhancements to valuidation tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga_parallel/pypar_extras/setup.py

    r8516 r8533  
    5050
    5151def _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
    5854    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   
    6663
    6764
     
    7168    # LAM/OPENMPI/MPICH2
    7269    output = _run_command('mpicc -show')
     70
     71
    7372    if output:
    7473        return output
Note: See TracChangeset for help on using the changeset viewer.