[Python-checkins] r78836 - python/trunk/Lib/test/test_sys.py

victor.stinner python-checkins at python.org
Thu Mar 11 14:27:35 CET 2010


Author: victor.stinner
Date: Thu Mar 11 14:27:35 2010
New Revision: 78836
Log:
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.
Modified:
 python/trunk/Lib/test/test_sys.py
Modified: python/trunk/Lib/test/test_sys.py
==============================================================================
--- python/trunk/Lib/test/test_sys.py	(original)
+++ python/trunk/Lib/test/test_sys.py	Thu Mar 11 14:27:35 2010
@@ -443,11 +443,11 @@
 # 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):
 


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /