mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +00:00
asyncio.streams.StreamReader: Add 'at_eof()' method
This commit is contained in:
parent
e694c9745f
commit
f0020f5d77
2 changed files with 19 additions and 0 deletions
|
@ -293,6 +293,10 @@ class StreamReader:
|
|||
if not waiter.cancelled():
|
||||
waiter.set_result(True)
|
||||
|
||||
def at_eof(self):
|
||||
"""Return True if the buffer is empty and 'feed_eof' was called."""
|
||||
return self._eof and not self._buffer
|
||||
|
||||
def feed_data(self, data):
|
||||
assert not self._eof, 'feed_data after feed_eof'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue