Amos Anderson <nitroa...@gmail.com> added the comment:
If I do this instead: ``` try: logger.info("raising exception") raise ValueError("my exception1") finally: logger.info("stopped") loop.stop() await asyncio.sleep(0.5) ``` i.e., do an `await` instead of a `return`, then the original exception is also lost: ``` INFO:root:start DEBUG:asyncio:Using selector: EpollSelector INFO:root:raising exception INFO:root:stopped ERROR:root:Event loop stopped before Future completed. Traceback (most recent call last): File "test.py", line 37, in <module> asyncio.run(another_level()) File "/home/amos/miniconda3/lib/python3.8/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/home/amos/miniconda3/lib/python3.8/asyncio/base_events.py", line 614, in run_until_complete raise RuntimeError('Event loop stopped before Future completed.') RuntimeError: Event loop stopped before Future completed. INFO:root:done ``` it's also a bit surprising that my handler in `another_level` didn't see either exception, but I'm not really sure what I'd expect in that case. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue45894> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com