From efaa891b1f17a3224bb910047c0da4e0e2a1b255 Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Mon, 11 Aug 2008 19:13:57 +0000 Subject: [PATCH] Fixed #8235: use subprocess instead of popen3 so that Python 2.6 is happy. Thanks, Karen Tracey. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8309 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/admin_scripts/tests.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/regressiontests/admin_scripts/tests.py b/tests/regressiontests/admin_scripts/tests.py index 3cbcb1cf92..33c960dcbb 100644 --- a/tests/regressiontests/admin_scripts/tests.py +++ b/tests/regressiontests/admin_scripts/tests.py @@ -106,7 +106,12 @@ class AdminScriptTestCase(unittest.TestCase): # Move to the test directory and run os.chdir(test_dir) - stdin, stdout, stderr = os.popen3(cmd) + try: + from subprocess import Popen, PIPE + p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) + stdin, stdout, stderr = (p.stdin, p.stdout, p.stderr) + except ImportError: + stdin, stdout, stderr = os.popen3(cmd) out, err = stdout.read(), stderr.read() # Restore the old environment