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

Commit696e4ed

Browse files
committed
fix universal_newlines TypeError
1 parent1e4211b commit696e4ed

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎git/cmd.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,7 @@ def _kill_process(pid):
772772
status=0
773773
stdout_value=b''
774774
stderr_value=b''
775+
newline="\n"ifuniversal_newlineselseb"\n"
775776
try:
776777
ifoutput_streamisNone:
777778
ifkill_after_timeout:
@@ -783,9 +784,9 @@ def _kill_process(pid):
783784
stderr_value= ('Timeout: the command "%s" did not complete in %d '
784785
'secs.'% (" ".join(command),kill_after_timeout)).encode(defenc)
785786
# strip trailing "\n"
786-
ifstdout_value.endswith(b"\n"):
787+
ifstdout_value.endswith(newline):
787788
stdout_value=stdout_value[:-1]
788-
ifstderr_value.endswith(b"\n"):
789+
ifstderr_value.endswith(newline):
789790
stderr_value=stderr_value[:-1]
790791
status=proc.returncode
791792
else:
@@ -794,7 +795,7 @@ def _kill_process(pid):
794795
stdout_value=proc.stdout.read()
795796
stderr_value=proc.stderr.read()
796797
# strip trailing "\n"
797-
ifstderr_value.endswith(b"\n"):
798+
ifstderr_value.endswith(newline):
798799
stderr_value=stderr_value[:-1]
799800
status=proc.wait()
800801
# END stdout handling

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp