changeset 74:a5dd7b5d0be1

util, popen: hide subprocess window so a console doesn't open up on Windows
author Idan Kamara <idankk86@gmail.com>
date Mon, 26 Sep 2011 22:37:46 +0300
parents 77ae99e032f6
children f4f636ecca3e
files hglib/util.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hglib/util.py	Mon Sep 26 22:37:45 2011 +0300
+++ b/hglib/util.py	Mon Sep 26 22:37:46 2011 +0300
@@ -133,6 +133,11 @@
 
 close_fds = os.name == 'posix'
 
+startupinfo = None
+if os.name == 'nt':
+    startupinfo = subprocess.STARTUPINFO()
+    startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
+
 def popen(args, env={}):
     environ = None
     if env:
@@ -141,4 +146,4 @@
 
     return subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
                             stderr=subprocess.PIPE, close_fds=close_fds,
-                            env=environ)
+                            startupinfo=startupinfo, env=environ)