Fix test_executable introduce in previous commit (r78835): Windows is able to

retrieve the absolute Python path even if argv[0] has been set to a non
existent program name.
This commit is contained in:
Victor Stinner 2010-03-11 13:27:35 +00:00
parent 4a7e0c858c
commit 6ecd85f401
1 changed files with 2 additions and 2 deletions

View File

@ -443,11 +443,11 @@ class SysModuleTest(unittest.TestCase):
# retrieve the real program name
import subprocess
p = subprocess.Popen(
["nonexistent", "-c", 'import sys; print "executable=%r" % sys.executable'],
["nonexistent", "-c", 'import sys; print repr(sys.executable)'],
executable=sys.executable, stdout=subprocess.PIPE)
executable = p.communicate()[0].strip()
p.wait()
self.assertEqual(executable, "executable=''")
self.assertIn(executable, ["''", repr(sys.executable)])
class SizeofTest(unittest.TestCase):