[Python-checkins] r77420 - python/trunk/Lib/test/test_popen.py
benjamin.peterson
python-checkins at python.org
Sun Jan 10 21:42:03 CET 2010
Author: benjamin.peterson
Date: Sun Jan 10 21:42:03 2010
New Revision: 77420
Log:
fix test_popen when the path to python has spaces #7671
Modified:
python/trunk/Lib/test/test_popen.py
Modified: python/trunk/Lib/test/test_popen.py
==============================================================================
--- python/trunk/Lib/test/test_popen.py (original)
+++ python/trunk/Lib/test/test_popen.py Sun Jan 10 21:42:03 2010
@@ -14,12 +14,10 @@
# 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)
More information about the Python-checkins
mailing list