mirror of
https://github.com/django/django.git
synced 2025-01-26 18:19:18 +00:00
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
This commit is contained in:
parent
a62ce30661
commit
cac7818e5e
@ -9,6 +9,7 @@ import os
|
|||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import socket
|
import socket
|
||||||
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
@ -111,27 +112,14 @@ class AdminScriptTestCase(unittest.TestCase):
|
|||||||
python_path.extend(ext_backend_base_dirs)
|
python_path.extend(ext_backend_base_dirs)
|
||||||
os.environ[python_path_var_name] = os.pathsep.join(python_path)
|
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
|
# Silence the DeprecationWarning caused by having a locale directory
|
||||||
# in the project directory.
|
# in the project directory.
|
||||||
if ' ' in executable:
|
cmd = [sys.executable, '-Wignore:::django.utils.translation', script]
|
||||||
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)
|
|
||||||
|
|
||||||
# Move to the test directory and run
|
# Move to the test directory and run
|
||||||
os.chdir(test_dir)
|
os.chdir(test_dir)
|
||||||
try:
|
out, err = subprocess.Popen(cmd + args,
|
||||||
from subprocess import Popen, PIPE
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
|
||||||
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()
|
|
||||||
|
|
||||||
# Restore the old environment
|
# Restore the old environment
|
||||||
if old_django_settings_module:
|
if old_django_settings_module:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user