]> granicus.if.org Git - python/commitdiff
Fix test_subprocess so that it works when launched from another directory than
authorAntoine Pitrou <solipsis@pitrou.net>
Sun, 29 Mar 2009 19:30:55 +0000 (19:30 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Sun, 29 Mar 2009 19:30:55 +0000 (19:30 +0000)
the source dist.

Lib/test/test_subprocess.py

index 20704952f4313ddf1142f9ef7fa7e77413d93c09..66aebfcf7f6146a96c55db105cc5693eb0cdd5b9 100644 (file)
@@ -142,8 +142,9 @@ class ProcessTestCase(unittest.TestCase):
         self.assertEqual(p.stderr, None)
 
     def test_executable(self):
-        p = subprocess.Popen(["somethingyoudonthave",
-                              "-c", "import sys; sys.exit(47)"],
+        arg0 = os.path.join(os.path.dirname(sys.executable),
+                            "somethingyoudonthave")
+        p = subprocess.Popen([arg0, "-c", "import sys; sys.exit(47)"],
                              executable=sys.executable)
         p.wait()
         self.assertEqual(p.returncode, 47)