Author serhiy.storchaka
Recipients Amos.Anderson, asvetlov, serhiy.storchaka, yselivanov
Date 2021-11-24.21:30:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1637789436.01.0.150867620172.issue45894@roundup.psfhosted.org>
In-reply-to
Content
It is not related to loop.stop() and asyncio in general. It is the return statement which eats the exception. Simpler example:

>>> def f():
...     try:
...         1/0
...     finally:
...         return 42
... 
>>> f()
42

Return (and also break and continue) in the finally block cancel an exception if it was raised.
History
Date User Action Args
2021-11-24 21:30:36serhiy.storchakasetrecipients: + serhiy.storchaka, asvetlov, Amos.Anderson, yselivanov
2021-11-24 21:30:36serhiy.storchakasetmessageid: <1637789436.01.0.150867620172.issue45894@roundup.psfhosted.org>
2021-11-24 21:30:35serhiy.storchakalinkissue45894 messages
2021-11-24 21:30:35serhiy.storchakacreate