Skip to content
Snippets Groups Projects
Commit 90e564882f07 authored by Matt Harbison's avatar Matt Harbison
Browse files

procutil: avoid `+= None` when writing to full std{err,out} descriptor on py3

The write function returns `None` if there was no room to write the given
data[1].  I don't like that this is effectively an infinite loop if there's
never any progress emptying the underlying buffer, but we're no worse off than
before, and it fixes random stacktrace popups seen in the py3 build of
TortoiseHg.

[1] https://docs.python.org/3/library/io.html#io.RawIOBase.write

Differential Revision: https://phab.mercurial-scm.org/D12555
parent 770e1352e9f9
No related branches found
No related tags found
No related merge requests found
......@@ -112,7 +112,9 @@
total_to_write = len(s)
total_written = 0
while total_written < total_to_write:
total_written += write1(m[total_written:])
c = write1(m[total_written:])
if c:
total_written += c
return total_written
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment