summaryrefslogtreecommitdiff
path: root/asyncio/streams.py
diff options
context:
space:
mode:
Diffstat (limited to 'asyncio/streams.py')
-rw-r--r--asyncio/streams.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/asyncio/streams.py b/asyncio/streams.py
index 6cd60c4..902d1ca 100644
--- a/asyncio/streams.py
+++ b/asyncio/streams.py
@@ -240,6 +240,7 @@ class StreamReaderProtocol(FlowControlMixin, protocols.Protocol):
def eof_received(self):
self._stream_reader.feed_eof()
+ return True
class StreamWriter:
@@ -321,6 +322,24 @@ class StreamReader:
self._transport = None
self._paused = False
+ def __repr__(self):
+ info = ['StreamReader']
+ if self._buffer:
+ info.append('%d bytes' % len(info))
+ if self._eof:
+ info.append('eof')
+ if self._limit != _DEFAULT_LIMIT:
+ info.append('l=%d' % self._limit)
+ if self._waiter:
+ info.append('w=%r' % self._waiter)
+ if self._exception:
+ info.append('e=%r' % self._exception)
+ if self._transport:
+ info.append('t=%r' % self._transport)
+ if self._paused:
+ info.append('paused')
+ return '<%s>' % ' '.join(info)
+
def exception(self):
return self._exception