gh-108082: Add PyErr_FormatUnraisable() function by serhiy-storchaka 路 Pull Request #111086 路 python/cpython (original) (raw)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind to give examples? I'm not sure how to use this API.
I understood that PyErr_WriteUnraisable(obj) can be written as:
PyErr_FormatUnraisable("Exception ignored in: %R", obj);
And without an exception an object, it should be:
PyErr_FormatUnraisable("Exception ignored in:");
Do the format must end with a newline character?
If format is
NULL
, only the traceback is printed.
What's the usage of this mode? Is the caller expected to log something like "Exception ignored in xxx" manually?