Ticket #8235: popen.diff

File popen.diff, 777 bytes (added by kmtracey, 7 years ago)
  • tests/regressiontests/admin_scripts/tests.py

     
    106106
    107107        # Move to the test directory and run
    108108        os.chdir(test_dir)
    109         stdin, stdout, stderr = os.popen3(cmd)
     109        try:
     110            from subprocess import Popen, PIPE
     111            p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
     112            stdin, stdout, stderr = (p.stdin, p.stdout, p.stderr)
     113        except ImportError:
     114            stdin, stdout, stderr = os.popen3(cmd)
    110115        out, err = stdout.read(), stderr.read()
    111116
    112117        # Restore the old environment
Back to Top