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

Steve Barnes gadgetsteve at hotmail.com
Tue Feb 19 03:11:31 CST 2013




# 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)

On WinNT with Python 2.6.x import hglib fails because subprocess has no 
STARTF_USESHOWWINDOW

member this patch checks for the availability before using it.

diff -r 5fe53db61aa4 -r 97b7c13ff817 hglib/util.py

--- a/hglib/util.py             Fri Feb 08 03:51:42 2013 -0800

+++ b/hglib/util.py          Tue Feb 19 08:39:14 2013 +0000

@@ -163,7 +163,8 @@

startupinfo = None

if os.name == 'nt':

      startupinfo = subprocess.STARTUPINFO()

-    startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW

+    if hasattr(subprocess, 'STARTF_USESHOWWINDOW'):  # Not all pythons 
have this

+        startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW

  def popen(args, env={}):

      environ = None



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20130219/cb5fd560/attachment.html>


More information about the Mercurial-devel mailing list