[Python-checkins] r70696 - python/branches/py3k/Lib/test/test_subprocess.py

antoine.pitrou python-checkins at python.org
Sun Mar 29 21:30:55 CEST 2009


Author: antoine.pitrou
Date: Sun Mar 29 21:30:55 2009
New Revision: 70696

Log:
Fix test_subprocess so that it works when launched from another directory than
the source dist.



Modified:
   python/branches/py3k/Lib/test/test_subprocess.py

Modified: python/branches/py3k/Lib/test/test_subprocess.py
==============================================================================
--- python/branches/py3k/Lib/test/test_subprocess.py	(original)
+++ python/branches/py3k/Lib/test/test_subprocess.py	Sun Mar 29 21:30:55 2009
@@ -142,8 +142,9 @@
         self.assertEqual(p.stderr, None)
 
     def test_executable(self):
-        p = subprocess.Popen(["somethingyoudonthave",
-                              "-c", "import sys; sys.exit(47)"],
+        arg0 = os.path.join(os.path.dirname(sys.executable),
+                            "somethingyoudonthave")
+        p = subprocess.Popen([arg0, "-c", "import sys; sys.exit(47)"],
                              executable=sys.executable)
         p.wait()
         self.assertEqual(p.returncode, 47)


More information about the Python-checkins mailing list