From 45f8f20bdf1447fbfebd19a07412d337626ed6b0 Mon Sep 17 00:00:00 2001 From: Kostis Anagnostopoulos Date: Mon, 26 Sep 2016 19:42:42 +0200 Subject: Win, #519: FIX WinHangs: Popen() CREATE_NEW_PROCESS_GROUP to allow kill + FIXED most hangs BUT no more `git-daemon` un-killable! + Use logger for utils to replace stray print(). --- git/index/fun.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'git/index/fun.py') diff --git a/git/index/fun.py b/git/index/fun.py index 6026e232..818847a2 100644 --- a/git/index/fun.py +++ b/git/index/fun.py @@ -12,11 +12,10 @@ from stat import ( from io import BytesIO import os -import sys import subprocess from git.util import IndexFileSHA1Writer -from git.cmd import Git +from git.cmd import PROC_CREATIONFLAGS from git.exc import ( UnmergedEntriesError, HookExecutionError @@ -78,7 +77,7 @@ def run_commit_hook(name, index): cwd=index.repo.working_dir, close_fds=(os.name == 'posix'), universal_newlines=True, - creationflags=Git.CREATE_NO_WINDOW if sys.platform == 'win32' else 0,) + creationflags=PROC_CREATIONFLAGS,) stdout, stderr = cmd.communicate() cmd.stdout.close() cmd.stderr.close() -- cgit v1.2.3