mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
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:
parent
4a7e0c858c
commit
6ecd85f401
1 changed files with 2 additions and 2 deletions
|
@ -443,11 +443,11 @@ class SysModuleTest(unittest.TestCase):
|
||||||
# retrieve the real program name
|
# retrieve the real program name
|
||||||
import subprocess
|
import subprocess
|
||||||
p = subprocess.Popen(
|
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=sys.executable, stdout=subprocess.PIPE)
|
||||||
executable = p.communicate()[0].strip()
|
executable = p.communicate()[0].strip()
|
||||||
p.wait()
|
p.wait()
|
||||||
self.assertEqual(executable, "executable=''")
|
self.assertIn(executable, ["''", repr(sys.executable)])
|
||||||
|
|
||||||
class SizeofTest(unittest.TestCase):
|
class SizeofTest(unittest.TestCase):
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue