summaryrefslogtreecommitdiff
path: root/tests/regressiontests
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2008-08-11 19:13:57 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2008-08-11 19:13:57 +0000
commitefaa891b1f17a3224bb910047c0da4e0e2a1b255 (patch)
tree2cdfe175cec638083b95066b8d15ee8300e6fe0e /tests/regressiontests
parent161390390639bc6166a0d5f1e0f4c66952737a0b (diff)
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
Diffstat (limited to 'tests/regressiontests')
-rw-r--r--tests/regressiontests/admin_scripts/tests.py7
1 files changed, 6 insertions, 1 deletions
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