summaryrefslogtreecommitdiff
path: root/tests/regressiontests/admin_scripts/tests.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/regressiontests/admin_scripts/tests.py')
-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 cdc9556afe..6a739f4029 100644
--- a/tests/regressiontests/admin_scripts/tests.py
+++ b/tests/regressiontests/admin_scripts/tests.py
@@ -101,8 +101,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)