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

Commit7057b9b

Browse files
committed
In handle_process_output don't forward finalizer result
The git.cmd.handle_process_output function is non-public(git.cmd.__all__ only lists Git) but used throughout GitPython andreferenced in the git.util.RemoteProgress.new_message_handlerdocstring. Its finalizer argument is annotated to accept anoptional callable that always returns None. It is always used thisway in GitPython and RemoteProcess.new_message_handler is annotatedaccordingly. However, the handle_process_output docstring andimplementation had documented the return value as the result of thefinalizer, and the implementation had forwarded that result ifpassed.This modifies the docstring and implementation to disregard anyresult, in accordance with the everywhere-annotated assumption thatthe finalizer is conceptually void and the absence of any code inGitPython that uses the result of calling handle_process_output.None is now implicitly returned, simplifying the implementation andbringing it and the docstring in line with annotationd and usage.This would be a breaking change if done on a public function, butbecause handle_process_output is nonpublic (and documentation forit is omitted by Sphinx, so users probably don't wrongly think itis public), I believe this is safe and non-breaking.
1 parent86d0177 commit7057b9b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

‎git/cmd.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ def handle_process_output(
111111
112112
This function returns once the finalizer returns.
113113
114-
:return: Result of finalizer
115114
:param process: :class:`subprocess.Popen` instance
116115
:param stdout_handler: f(stdout_line_string), or None
117116
:param stderr_handler: f(stderr_line_string), or None
@@ -205,9 +204,7 @@ def pump_stream(
205204
stderr_handler(error_str)# type: ignore
206205

207206
iffinalizer:
208-
returnfinalizer(process)
209-
else:
210-
returnNone
207+
finalizer(process)
211208

212209

213210
defdashify(string:str)->str:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp