Similar to PyErr_NormalizeException in CPython
(
&self,
exc_type: PyObjectRef,
exc_val: PyObjectRef,
exc_tb: PyObjectRef,
)
| 336 | |
| 337 | /// Similar to PyErr_NormalizeException in CPython |
| 338 | pub fn normalize_exception( |
| 339 | &self, |
| 340 | exc_type: PyObjectRef, |
| 341 | exc_val: PyObjectRef, |
| 342 | exc_tb: PyObjectRef, |
| 343 | ) -> PyResult<PyBaseExceptionRef> { |
| 344 | let ctor = ExceptionCtor::try_from_object(self, exc_type)?; |
| 345 | let exc = ctor.instantiate_value(exc_val, self)?; |
| 346 | if let Some(tb) = Option::<PyTracebackRef>::try_from_object(self, exc_tb)? { |
| 347 | exc.set_traceback_typed(Some(tb)); |
| 348 | } |
| 349 | Ok(exc) |
| 350 | } |
| 351 | |
| 352 | pub fn invoke_exception( |
| 353 | &self, |
no test coverage detected