Message414824
'catch (boost::python::error_already_set e)' is equal to `except BaseException as e:`
In Python, blind catching base exception is dangerous, the code should re-raise it usually.
The same is true for boost::python usage.
> how would it tell the difference between a "real" exception raised from within whatever function is currently returning and the "fake" StopIteration exception that is in the error global while an async function returns?
There is no "fake" exception. async function is a kind of Python generator object that uses StopIteration exception for finishing.
The same is true for a regular Python iterator; nothing asyncio specific.
I suggest writing a functional equivalent for `except Exception as e: print(e)` instead of catching BaseException error. |
|
Date |
User |
Action |
Args |
2022-03-10 02:05:52 | asvetlov | set | recipients:
+ asvetlov, yselivanov, iritkatriel, zbentley |
2022-03-10 02:05:52 | asvetlov | set | messageid: <1646877952.85.0.684465838297.issue45033@roundup.psfhosted.org> |
2022-03-10 02:05:52 | asvetlov | link | issue45033 messages |
2022-03-10 02:05:52 | asvetlov | create | |
|