Fix the test_subprocess failure when sys.executable is meaningless: '' or a directory.

It does not fix #7774.
This commit is contained in:
Florent Xicluna 2010-03-11 00:56:59 +00:00
parent 85677617d5
commit e58d91c8f0
2 changed files with 4 additions and 3 deletions

View file

@ -135,7 +135,7 @@ class ProcessTestCase(unittest.TestCase):
self.assertEqual(p.stderr, None)
def test_executable_with_cwd(self):
python_dir = os.path.dirname(os.path.realpath(sys.executable))
python_dir = os.path.realpath(os.path.dirname(sys.executable))
p = subprocess.Popen(["somethingyoudonthave", "-c",
"import sys; sys.exit(47)"],
executable=sys.executable, cwd=python_dir)