diff options
author | Yury Selivanov <yury@magic.io> | 2016-06-09 19:08:31 (GMT) |
---|---|---|
committer | Yury Selivanov <yury@magic.io> | 2016-06-09 19:08:31 (GMT) |
commit | a6f6edbda8648698289a8ee7abef6a35c924151b (patch) | |
tree | 9eb77fd4f552bcabfb46a3938d0ded084e7709f9 /Lib/asyncio/streams.py | |
parent | ebe95fdabb42b02ff7eecab6bc9637cf5ccf1d2c (diff) | |
download | cpython-a6f6edbda8648698289a8ee7abef6a35c924151b.zip cpython-a6f6edbda8648698289a8ee7abef6a35c924151b.tar.gz cpython-a6f6edbda8648698289a8ee7abef6a35c924151b.tar.bz2 |
Issue #27243: Fix __aiter__ protocol
Diffstat (limited to 'Lib/asyncio/streams.py')
-rw-r--r-- | Lib/asyncio/streams.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py index 6f465af..c88a87c 100644 --- a/Lib/asyncio/streams.py +++ b/Lib/asyncio/streams.py @@ -689,3 +689,9 @@ class StreamReader: if val == b'': raise StopAsyncIteration return val + + if compat.PY352: + # In Python 3.5.2 and greater, __aiter__ should return + # the asynchronous iterator directly. + def __aiter__(self): + return self |