Example #1
0
// int PyErr_GivenExceptionMatches(PyObject *given, PyObject *exc)
// Return true if the given exception matches the exception in exc. If exc is a class object, this also returns true when given is an instance of a subclass. If exc is a tuple, all exceptions in the tuple (and recursively in subtuples) are searched for a match.
func PyErr_GivenExceptionMatches(given, exc *PyObject) bool {
	return int2bool(C.PyErr_GivenExceptionMatches(topy(given), topy(exc)))
}
Example #2
0
File: err.go Project: gbbr/textmate
// 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_GivenExceptionMatches(c(e.Kind), c(exc)) != 0
}