* // 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
()
| 67 | // class, Normalize will fix this. The separate normalization is implemented in |
| 68 | // Python to improve performance. |
| 69 | func (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. |