diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2014-02-06 05:14:30 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2014-02-06 05:14:30 (GMT) |
commit | f0020f5d7762a73e77bc7be79251e2ebb3a4a727 (patch) | |
tree | 2a5b1e0f1a287c571c261632a846fa21241c092b /Lib/asyncio/streams.py | |
parent | e694c9745f2a9cbb46154e290c84c02d77066055 (diff) | |
download | cpython-f0020f5d7762a73e77bc7be79251e2ebb3a4a727.zip cpython-f0020f5d7762a73e77bc7be79251e2ebb3a4a727.tar.gz cpython-f0020f5d7762a73e77bc7be79251e2ebb3a4a727.tar.bz2 |
asyncio.streams.StreamReader: Add 'at_eof()' method
Diffstat (limited to 'Lib/asyncio/streams.py')
-rw-r--r-- | Lib/asyncio/streams.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py index 3da1d10..8fc2147 100644 --- a/Lib/asyncio/streams.py +++ b/Lib/asyncio/streams.py @@ -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' |