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

Commitdf95898

Browse files
committed
refactor(cmd): streamline usage of creationflags
1 parentd8ef023 commitdf95898

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

‎git/cmd.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@
4343
safe_decode,
4444
)
4545

46-
# value of Windows process creation flag taken from MSDN
47-
CREATE_NO_WINDOW=0x08000000
48-
4946
execute_kwargs= ('istream','with_keep_cwd','with_extended_output',
5047
'with_exceptions','as_process','stdout_as_string',
5148
'output_stream','with_stdout','kill_after_timeout',
@@ -249,6 +246,9 @@ class Git(LazyMixin):
249246
# Enables debugging of GitPython's git commands
250247
GIT_PYTHON_TRACE=os.environ.get("GIT_PYTHON_TRACE",False)
251248

249+
# value of Windows process creation flag taken from MSDN
250+
CREATE_NO_WINDOW=0x08000000
251+
252252
# Provide the full path to the git executable. Otherwise it assumes git is in the path
253253
_git_exec_env_var="GIT_PYTHON_GIT_EXECUTABLE"
254254
GIT_PYTHON_GIT_EXECUTABLE=os.environ.get(_git_exec_env_var,git_exec_name)
@@ -611,12 +611,8 @@ def execute(self, command,
611611
cmd_not_found_exception=OSError
612612
# end handle
613613

614+
creationflags=self.CREATE_NO_WINDOWifsys.platform=='win32'else0
614615
try:
615-
ifsys.platform=='win32':
616-
creationflags=CREATE_NO_WINDOW
617-
else:
618-
creationflags=0
619-
620616
proc=Popen(command,
621617
env=env,
622618
cwd=cwd,
@@ -638,11 +634,6 @@ def execute(self, command,
638634

639635
def_kill_process(pid):
640636
""" Callback method to kill a process. """
641-
ifsys.platform=='win32':
642-
creationflags=CREATE_NO_WINDOW
643-
else:
644-
creationflags=0
645-
646637
p=Popen(['ps','--ppid',str(pid)],stdout=PIPE,creationflags=creationflags)
647638
child_pids= []
648639
forlineinp.stdout:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp