Last active
March 22, 2019 23:54
-
-
Save ask/fb1f0aba00a28f62ed6d56453790fc9b to your computer and use it in GitHub Desktop.
Revisions
-
ask revised this gist
Mar 22, 2019 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -15,8 +15,6 @@ class Bar: for i in range(10): try: yield i finally: print('FOO') -
ask created this gist
Mar 22, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ # 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 except Exception as exc: print('GOT ERROR: %r' % (exc,)) finally: print('FOO') if __name__ == '__main__': import asyncio loop = asyncio.get_event_loop()