]> granicus.if.org Git - python/commitdiff
fix issue2381: test_subprocess fails if your sys.executable is on a
authorGregory P. Smith <greg@mad-scientist.com>
Sat, 17 May 2008 07:17:34 +0000 (07:17 +0000)
committerGregory P. Smith <greg@mad-scientist.com>
Sat, 17 May 2008 07:17:34 +0000 (07:17 +0000)
path with a space in it.

Lib/test/test_subprocess.py

index 3195339e9f7c95ac35078c093e848ba84ffb0784..f31ce75ad0e3f2646ddb33d9cff9769d1f876840 100644 (file)
@@ -534,7 +534,7 @@ class ProcessTestCase(unittest.TestCase):
             # args is a string
             f, fname = self.mkstemp()
             os.write(f, "#!/bin/sh\n")
-            os.write(f, "exec %s -c 'import sys; sys.exit(47)'\n" %
+            os.write(f, "exec '%s' -c 'import sys; sys.exit(47)'\n" %
                         sys.executable)
             os.close(f)
             os.chmod(fname, 0700)
@@ -576,7 +576,7 @@ class ProcessTestCase(unittest.TestCase):
             # call() function with string argument on UNIX
             f, fname = self.mkstemp()
             os.write(f, "#!/bin/sh\n")
-            os.write(f, "exec %s -c 'import sys; sys.exit(47)'\n" %
+            os.write(f, "exec '%s' -c 'import sys; sys.exit(47)'\n" %
                         sys.executable)
             os.close(f)
             os.chmod(fname, 0700)