New submission from Arthur Darcet: Here is the example code I am running:
``` import asyncio class it: async def __aenter__(self): return self async def __aexit__(self, *_): print('EXIT') async def main(): async with it(): await asyncio.sleep(100) asyncio.get_event_loop().run_until_complete(main()) ``` When this gets interrupted by a SIGINT, I would expect this code to display `EXIT` before the `KeyboardInterrupt` stacktrace. But instead the `__aexit__` function is simply not called. ---------- components: asyncio messages: 296106 nosy: rthr, yselivanov priority: normal pull_requests: 2264 severity: normal status: open title: __aexit__ not called when `run_until_complete` is interrupted by SIGINT versions: Python 3.5, Python 3.6, Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30679> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com