[PATCH] Issue 3832 - STARTF_USESHOWWINDOW not available on WinNT Python 2.6.6

Siddharth Agarwal sid0 at fb.com
Tue Feb 19 19:42:58 CST 2013


On 02/19/2013 01:11 AM, Steve Barnes wrote:
>
> # HG changeset patch
>
> # User Steve Barnes <gadgetsteve at hotmail.com>
>
> # Date 1361263154 0
>
> # Node ID 97b7c13ff8173c257143b9bcabb8ad726ade98cc
>
> # Parent 5fe53db61aa433018de8b0ee296db868f666cee7
>
> util: cope with missing subprocess.startf_useshowwindow in python 
> 2.6.x on nt (issue3832)
>

This is too long. I'd suggest something like

"util: hardcode STARTF_USESHOWWINDOW"

with a note in the full message explaining why (it isn't present in some 
newer versions of Python).

> -    startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
>
> +    if hasattr(subprocess, 'STARTF_USESHOWWINDOW'):  # Not all 
> pythons have this
>
> +        startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
>

Why not just hardcode the value? That's 1 according to 
http://msdn.microsoft.com/en-us/library/windows/desktop/ms686331%28v=vs.85%29.aspx.


More information about the Mercurial-devel mailing list