From a6f6edbda8648698289a8ee7abef6a35c924151b Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Thu, 9 Jun 2016 15:08:31 -0400 Subject: Issue #27243: Fix __aiter__ protocol --- Lib/asyncio/streams.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Lib/asyncio/streams.py') diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py index 6f465afde2..c88a87cd09 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 -- cgit v1.2.1