summaryrefslogtreecommitdiff
path: root/tests/regressiontests/admin_scripts/tests.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2011-12-27 14:54:00 +0000
committerAymeric Augustin <aymeric.augustin@m4x.org>2011-12-27 14:54:00 +0000
commitcac7818e5ee83db486c170cb0002eb3f41d4fa84 (patch)
treedb13b7d529002ba9f79044f6791421df9d36ce7d /tests/regressiontests/admin_scripts/tests.py
parenta62ce30661c62606b5648ac27ac808bbb1b0e6bb (diff)
Removed Python 2.3 compatibility code from the admin_scripts tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17279 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/admin_scripts/tests.py')
-rw-r--r--tests/regressiontests/admin_scripts/tests.py20
1 files changed, 4 insertions, 16 deletions
diff --git a/tests/regressiontests/admin_scripts/tests.py b/tests/regressiontests/admin_scripts/tests.py
index 8fd74db556..d489e05296 100644
--- a/tests/regressiontests/admin_scripts/tests.py
+++ b/tests/regressiontests/admin_scripts/tests.py
@@ -9,6 +9,7 @@ import os
import re
import shutil
import socket
+import subprocess
import sys
import urllib
@@ -111,27 +112,14 @@ class AdminScriptTestCase(unittest.TestCase):
python_path.extend(ext_backend_base_dirs)
os.environ[python_path_var_name] = os.pathsep.join(python_path)
- # Build the command line
- executable = sys.executable
- arg_string = ' '.join(['%s' % arg for arg in args])
# Silence the DeprecationWarning caused by having a locale directory
# in the project directory.
- if ' ' in executable:
- cmd = '""%s" -Wignore:::django.utils.translation "%s" %s"' % (executable, script, arg_string)
- else:
- cmd = '%s -Wignore:::django.utils.translation "%s" %s' % (executable, script, arg_string)
+ cmd = [sys.executable, '-Wignore:::django.utils.translation', script]
# Move to the test directory and run
os.chdir(test_dir)
- try:
- from subprocess import Popen, PIPE
- except ImportError:
- stdin, stdout, stderr = os.popen3(cmd)
- else:
- p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE)
- stdin, stdout, stderr = (p.stdin, p.stdout, p.stderr)
- p.wait()
- out, err = stdout.read(), stderr.read()
+ out, err = subprocess.Popen(cmd + args,
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
# Restore the old environment
if old_django_settings_module: