Skip to content
This repository was archived by the owner on Nov 23, 2017. It is now read-only.

Commit dfae386

Browse files
committed
Sync with CPython (PEP 492 __aiter__ update)
1 parent e394497 commit dfae386

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

asyncio/compat.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
PY34 = sys.version_info >= (3, 4)
66
PY35 = sys.version_info >= (3, 5)
7+
PY352 = sys.version_info >= (3, 5, 2)
78

89

910
def flatten_list_bytes(list_of_data):

asyncio/streams.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,3 +689,9 @@ def __anext__(self):
689689
if val == b'':
690690
raise StopAsyncIteration
691691
return val
692+
693+
if compat.PY352:
694+
# In Python 3.5.2 and greater, __aiter__ should return
695+
# the asynchronous iterator directly.
696+
def __aiter__(self):
697+
return self

0 commit comments

Comments
 (0)