It would result in a partial message. The server seems to do the right
thing anyway, but let's not waste its precious time.
using the `Copy` object outside a block.
"""
if self._direction == COPY_IN:
- if data := self.formatter.end():
- self._write(data)
+ if not exc:
+ if data := self.formatter.end():
+ self._write(data)
self.writer.finish(exc)
self._finished = True
else:
using the `Copy` object outside a block.
"""
if self._direction == COPY_IN:
- if data := self.formatter.end():
- await self._write(data)
+ if not exc:
+ if data := self.formatter.end():
+ await self._write(data)
await self.writer.finish(exc)
self._finished = True
else: