← Back to team overview

dulwich-users team mailing list archive

Re: [PATCH 1/2] blackbox: pass python.exe for Windows

 

On Mon, Dec 27, 2010 at 02:12:42AM +0800, Tay Ray Chuan wrote:
> diff --git a/dulwich/tests/__init__.py b/dulwich/tests/__init__.py
> index 45e82b9..9a3c93c 100644
> --- a/dulwich/tests/__init__.py
> +++ b/dulwich/tests/__init__.py
> @@ -81,7 +81,16 @@ class BlackboxTestCase(TestCase):
>          """
>          env = dict(os.environ)
>          env["PYTHONPATH"] = os.pathsep.join(sys.path)
> -        return subprocess.Popen([self.bin_path(name)] + args,
> +        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,
>              stdout=subprocess.PIPE,
>              stdin=subprocess.PIPE, stderr=subprocess.PIPE,
>              env=env)
Thanks, merged with a tweak (removed the special casing for Windows).

Cheers,

Jelmer



References