diff options
author | Yury Selivanov <yury@magic.io> | 2017-10-06 06:08:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-06 06:08:57 (GMT) |
commit | faa135acbfcd55f79fb97f7525c8aa6f5a5b6a22 (patch) | |
tree | 8fd008b849b322699e20e18f92a179c06f7b0580 /Lib/asyncio | |
parent | 86566702f311f8e90600e85350f6b6769a384ea5 (diff) | |
download | cpython-faa135acbfcd55f79fb97f7525c8aa6f5a5b6a22.zip cpython-faa135acbfcd55f79fb97f7525c8aa6f5a5b6a22.tar.gz cpython-faa135acbfcd55f79fb97f7525c8aa6f5a5b6a22.tar.bz2 |
bpo-31709: Drop support for asynchronous __aiter__. (#3903)
Diffstat (limited to 'Lib/asyncio')
-rw-r--r-- | Lib/asyncio/streams.py | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/Lib/asyncio/streams.py b/Lib/asyncio/streams.py index a82cc79..9fda853 100644 --- a/Lib/asyncio/streams.py +++ b/Lib/asyncio/streams.py @@ -676,20 +676,12 @@ class StreamReader: self._maybe_resume_transport() return data - if compat.PY35: - @coroutine - def __aiter__(self): - return self - - @coroutine - def __anext__(self): - val = yield from self.readline() - 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 + def __aiter__(self): + return self + + @coroutine + def __anext__(self): + val = yield from self.readline() + if val == b'': + raise StopAsyncIteration + return val |