Helper function for normalizing the error by deconstructing and reconstructing the PyErr. Must not panic for safety in normalize()
(self, py: Python)
| 342 | /// Helper function for normalizing the error by deconstructing and reconstructing the PyErr. |
| 343 | /// Must not panic for safety in normalize() |
| 344 | fn into_normalized(self, py: Python) -> PyErr { |
| 345 | let PyErr { |
| 346 | ptype, |
| 347 | pvalue, |
| 348 | ptraceback, |
| 349 | } = self; |
| 350 | let mut ptype = ptype.steal_ptr(); |
| 351 | let mut pvalue = pvalue.steal_ptr(py); |
| 352 | let mut ptraceback = ptraceback.steal_ptr(py); |
| 353 | unsafe { |
| 354 | ffi::PyErr_NormalizeException(&mut ptype, &mut pvalue, &mut ptraceback); |
| 355 | PyErr::new_from_ffi_tuple(py, ptype, pvalue, ptraceback) |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | /// Retrieves the exception type. |
| 360 | /// |