MCPcopy Create free account
hub / github.com/dgrunwald/rust-cpython / instance

Method instance

src/err.rs:385–391  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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()`.

Callers

nothing calls this directly

Calls 3

normalizeMethod · 0.80
NoneMethod · 0.80
clone_refMethod · 0.45

Tested by

no test coverage detected