diff options
| author | Benjamin Peterson <benjamin@python.org> | 2010-01-10 20:42:03 (GMT) |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2010-01-10 20:42:03 (GMT) |
| commit | e822ab01664261c7b0e88c705c4b063bdd82b005 (patch) | |
| tree | 6b47fcf88c15ee1f03a8e71b16709ec71d908894 /Lib/test/test_popen.py | |
| parent | 0e207dff31f1cd4fa65e56d095bcf25c5ee1685f (diff) | |
| download | cpython-e822ab01664261c7b0e88c705c4b063bdd82b005.zip cpython-e822ab01664261c7b0e88c705c4b063bdd82b005.tar.gz cpython-e822ab01664261c7b0e88c705c4b063bdd82b005.tar.bz2 | |
fix test_popen when the path to python has spaces #7671
Diffstat (limited to 'Lib/test/test_popen.py')
| -rw-r--r-- | Lib/test/test_popen.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/test/test_popen.py b/Lib/test/test_popen.py index cb65fdf..454ba17 100644 --- a/Lib/test/test_popen.py +++ b/Lib/test/test_popen.py @@ -14,12 +14,10 @@ import os, sys # This results in Python being spawned and printing the sys.argv list. # We can then eval() the result of this, and see what each argv was. python = sys.executable -if ' ' in python: - python = '"' + python + '"' # quote embedded space for cmdline class PopenTest(unittest.TestCase): def _do_test_commandline(self, cmdline, expected): - cmd = '%s -c "import sys;print sys.argv" %s' % (python, cmdline) + cmd = '%r -c "import sys;print sys.argv" %s' % (python, cmdline) data = os.popen(cmd).read() got = eval(data)[1:] # strip off argv[0] self.assertEqual(got, expected) |
