Retrieves the exception instance for this error. This method takes `&mut self` because the error might need to be normalized in order to create the exception instance.
(&mut self, py: Python)
| 383 | /// This method takes `&mut self` because the error might need |
| 384 | /// to be normalized in order to create the exception instance. |
| 385 | pub fn instance(&mut self, py: Python) -> PyObject { |
| 386 | self.normalize(py); |
| 387 | match self.pvalue { |
| 388 | Some(ref instance) => instance.clone_ref(py), |
| 389 | None => py.None(), |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | /// Writes the error back to the Python interpreter's global state. |
| 394 | /// This is the opposite of `PyErr::fetch()`. |