File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -772,6 +772,7 @@ def _kill_process(pid):
772772 status = 0
773773 stdout_value = b''
774774 stderr_value = b''
775+ newline = "\n " if universal_newlines else b"\n "
775776 try :
776777 if output_stream is None :
777778 if kill_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- if stdout_value .endswith (b" \n " ):
787+ if stdout_value .endswith (newline ):
787788 stdout_value = stdout_value [:- 1 ]
788- if stderr_value .endswith (b" \n " ):
789+ if stderr_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- if stderr_value .endswith (b" \n " ):
798+ if stderr_value .endswith (newline ):
798799 stderr_value = stderr_value [:- 1 ]
799800 status = proc .wait ()
800801 # END stdout handling
You can’t perform that action at this time.
0 commit comments