Skip to content

Commit

Permalink
write quick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dnozay committed Feb 10, 2020
1 parent 2c8ea94 commit 5669907
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions xmlrunner/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,19 @@ def writelines(self, lines):
self._second.writelines(lines)

def write(self, b):
wrote = self._first.write(b)
if isinstance(self._first, io.TextIOBase):
wrote = self._first.write(b)

if wrote is not None:
# expected to always succeed to write
self._second.write(b[:wrote])
if wrote is not None:
# expected to always succeed to write
self._second.write(b[:wrote])

return wrote
return wrote
else:
# file-like object that doesn't return wrote bytes.
self._first.write(b)
self._second.write(b)
return len(b)


class _TestInfo(object):
Expand Down

0 comments on commit 5669907

Please sign in to comment.