summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Tracey <kmtracey@gmail.com>2010-03-23 18:56:37 +0000
committerKaren Tracey <kmtracey@gmail.com>2010-03-23 18:56:37 +0000
commitf0ed1ce6832c1ea54c3d324911c43a25aec99c4e (patch)
treee66c7e4fb6ff953d4180f4c51309fda7546972da
parent21a1a21d0b0373e211621e3881ae03008843a034 (diff)
[1.1.X] Fixed #13173: Made the admin_scripts tests pass when the running python executable has a space in its pathname. Thanks gabrielhurley.
r12842 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12843 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--tests/regressiontests/admin_scripts/tests.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/regressiontests/admin_scripts/tests.py b/tests/regressiontests/admin_scripts/tests.py
index e67126e9a7..50b1368f7d 100644
--- a/tests/regressiontests/admin_scripts/tests.py
+++ b/tests/regressiontests/admin_scripts/tests.py
@@ -102,8 +102,12 @@ class AdminScriptTestCase(unittest.TestCase):
os.environ[python_path_var_name] = os.pathsep.join(python_path)
# Build the command line
- cmd = '%s "%s"' % (sys.executable, script)
- cmd += ''.join([' %s' % arg for arg in args])
+ executable = sys.executable
+ arg_string = ' '.join(['%s' % arg for arg in args])
+ if ' ' in executable:
+ cmd = '""%s" "%s" %s"' % (executable, script, arg_string)
+ else:
+ cmd = '%s "%s" %s' % (executable, script, arg_string)
# Move to the test directory and run
os.chdir(test_dir)