Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0d93908

Browse files
committed
Prevent CMD windows being shown when starting git in a subprocess.
This fixes a UI problem with using GitPython from a GUI python probgram.Each repo that is opened creates a git cat-file processs and that provess will createa console window with out this change.
1 parent1116ef7 commit0d93908

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

‎git/cmd.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,12 @@ def execute(self, command,
609609
# end handle
610610

611611
try:
612+
ifsys.platform=='win32':
613+
CREATE_NO_WINDOW=0x08000000
614+
creationflags=CREATE_NO_WINDOW
615+
else:
616+
creationflags=None
617+
612618
proc=Popen(command,
613619
env=env,
614620
cwd=cwd,
@@ -619,6 +625,7 @@ def execute(self, command,
619625
shell=self.USE_SHELL,
620626
close_fds=(os.name=='posix'),# unsupported on windows
621627
universal_newlines=universal_newlines,
628+
creationflags=creationflags,
622629
**subprocess_kwargs
623630
)
624631
exceptcmd_not_found_exceptionaserr:
@@ -629,7 +636,13 @@ def execute(self, command,
629636

630637
def_kill_process(pid):
631638
""" Callback method to kill a process. """
632-
p=Popen(['ps','--ppid',str(pid)],stdout=PIPE)
639+
ifsys.platform=='win32':
640+
CREATE_NO_WINDOW=0x08000000
641+
creationflags=CREATE_NO_WINDOW
642+
else:
643+
creationflags=None
644+
645+
p=Popen(['ps','--ppid',str(pid)],stdout=PIPE,creationflags)
633646
child_pids= []
634647
forlineinp.stdout:
635648
iflen(line.split())>0:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp