Skip to content

Commit

Permalink
Merge pull request python-trio#517 from jab/aiter
Browse files Browse the repository at this point in the history
Factor Python 3.5.2 check out of aiter_compat implementation
  • Loading branch information
njsmith committed May 20, 2018
2 parents 27e36df + acd758c commit 39f9f74
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions trio/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,16 @@ def signal_raise(signum):


# Decorator to handle the change to __aiter__ in 3.5.2
def aiter_compat(aiter_impl):
if sys.version_info < (3, 5, 2):
if sys.version_info < (3, 5, 2):

def aiter_compat(aiter_impl):
@wraps(aiter_impl)
async def __aiter__(*args, **kwargs):
return aiter_impl(*args, **kwargs)

return __aiter__
else:
return aiter_impl
else:
aiter_compat = lambda aiter_impl: aiter_impl


# See: #461 as to why this is needed.
Expand Down

0 comments on commit 39f9f74

Please sign in to comment.