فهرست منبع

BlackboxTest: Always use sys.executable, not just for Windows NT.

Jelmer Vernooij 14 سال پیش
والد
کامیت
ccabb566a9
1فایلهای تغییر یافته به همراه2 افزوده شده و 4 حذف شده
  1. 2 4
      dulwich/tests/__init__.py

+ 2 - 4
dulwich/tests/__init__.py

@@ -81,16 +81,14 @@ class BlackboxTestCase(TestCase):
         """
         env = dict(os.environ)
         env["PYTHONPATH"] = os.pathsep.join(sys.path)
-        args.insert(0, self.bin_path(name))
 
         # Since they don't have any extensions, Windows can't recognize
         # executablility of the Python files in /bin. Even then, we'd have to
         # expect the user to set up file associations for .py files.
         #
         # Save us from all that headache and call python with the bin script.
-        if os.name == "nt":
-            args.insert(0, sys.executable)
-        return subprocess.Popen(args,
+        argv = [sys.executable, self.bin_path(name)] + args
+        return subprocess.Popen(argv,
             stdout=subprocess.PIPE,
             stdin=subprocess.PIPE, stderr=subprocess.PIPE,
             env=env)