* @brief Helper function to wrap the current exception with a custom prefix message. * A example is augmenting the argument parsing error with the name of the variable * that didn't pass the validation. */
| 905 | * that didn't pass the validation. |
| 906 | */ |
| 907 | void wrap_current_exception(sz_cptr_t comment) { |
| 908 | // ? Prior to Python 3.12 we need to fetch and restore the exception state using |
| 909 | // ? `PyErr_Fetch` and `PyErr_Restore` to avoid overwriting the current exception. |
| 910 | // ? After Python 3.12 we can use `PyErr_GetRaisedException` and `PyErr_SetRaisedException`. |
| 911 | sz_unused_(comment); |
| 912 | } |
| 913 | |
| 914 | typedef void (*get_string_at_offset_t)(Strs *, Py_ssize_t, Py_ssize_t, PyObject **, sz_cptr_t *, sz_size_t *); |
| 915 |
no outgoing calls
no test coverage detected
searching dependent graphs…