Last active
March 22, 2019 23:54
-
-
Save ask/fb1f0aba00a28f62ed6d56453790fc9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# finally: behavior changed from Python 3.6 to Python 3.7 | |
async def foo(): | |
try: | |
async for item in Bar(): | |
raise Exception('foo') | |
except Exception: | |
pass | |
class Bar: | |
async def __aiter__(self): | |
for i in range(10): | |
try: | |
yield i | |
finally: | |
print('FOO') | |
if __name__ == '__main__': | |
import asyncio | |
loop = asyncio.get_event_loop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment