mirror of https://github.com/python/cpython
Fix test_subprocess so that it works when launched from another directory than
the source dist.
This commit is contained in:
parent
0dd737b5ab
commit
5550365f4b
|
@ -142,8 +142,9 @@ class ProcessTestCase(unittest.TestCase):
|
||||||
self.assertEqual(p.stderr, None)
|
self.assertEqual(p.stderr, None)
|
||||||
|
|
||||||
def test_executable(self):
|
def test_executable(self):
|
||||||
p = subprocess.Popen(["somethingyoudonthave",
|
arg0 = os.path.join(os.path.dirname(sys.executable),
|
||||||
"-c", "import sys; sys.exit(47)"],
|
"somethingyoudonthave")
|
||||||
|
p = subprocess.Popen([arg0, "-c", "import sys; sys.exit(47)"],
|
||||||
executable=sys.executable)
|
executable=sys.executable)
|
||||||
p.wait()
|
p.wait()
|
||||||
self.assertEqual(p.returncode, 47)
|
self.assertEqual(p.returncode, 47)
|
||||||
|
|
Loading…
Reference in New Issue