MCPcopy Create free account
hub / github.com/goplus/py / Normalize

Method Normalize

error.go:69–77  ·  view source on GitHub ↗

* // Matches returns true if e.Kind matches the exception in exc. If exc is a // Class, then true is returned if e.Kind is an instance. If exc is a Tuple, // then all elements (and recursively for sub elements) are searched for a // match. func (e *Error) Matches(exc Object) bool { return C.PyErr

()

Source from the content-addressed store, hash-verified

67// class, Normalize will fix this. The separate normalization is implemented in
68// Python to improve performance.
69func (e *Error) Normalize() {
70 exc := e.Kind.c()
71 val := e.Value.c()
72 tb := e.tb
73 C.PyErr_NormalizeException(&exc, &val, &tb)
74 e.Kind = newObject(exc)
75 e.Value = newObject(val)
76 e.tb = tb
77}
78
79// NewErrorV returns a new Error of the specified kind, and with the given
80// value.

Callers

nothing calls this directly

Calls 2

newObjectFunction · 0.85
cMethod · 0.80

Tested by

no test coverage detected