From: Antoine Pitrou Date: Sun, 29 Mar 2009 19:30:55 +0000 (+0000) Subject: Fix test_subprocess so that it works when launched from another directory than X-Git-Tag: v3.1a2~172 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5550365f4b14520297e47043f16f0ecff9081101;p=thirdparty%2FPython%2Fcpython.git Fix test_subprocess so that it works when launched from another directory than the source dist. --- diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 20704952f431..66aebfcf7f61 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -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)