From 3c19a6e1004bb8c116bfc7823477118490a2eef6 Mon Sep 17 00:00:00 2001 From: x-santiaga-x Date: Thu, 28 Jan 2021 14:16:53 +0300 Subject: fix universal_newlines TypeError Fixes #1116 --- git/cmd.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'git/cmd.py') diff --git a/git/cmd.py b/git/cmd.py index 31c0e859..050efaed 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -785,7 +785,9 @@ class Git(LazyMixin): watchdog.cancel() if kill_check.isSet(): stderr_value = ('Timeout: the command "%s" did not complete in %d ' - 'secs.' % (" ".join(command), kill_after_timeout)).encode(defenc) + 'secs.' % (" ".join(command), kill_after_timeout)) + if not universal_newlines: + stderr_value = stderr_value.encode(defenc) # strip trailing "\n" if stdout_value.endswith(newline): stdout_value = stdout_value[:-1] -- cgit v1.2.1