Skip to content

Commit 8d33c94

Browse files
committed
Fixing order of arguments in call to PyErr_GivenExceptionMatches in pybind11::error_already_set.matches
1 parent 25abf7e commit 8d33c94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/pybind11/pytypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ class error_already_set : public std::runtime_error {
344344
/// Check if the currently trapped error type matches the given Python exception class (or a
345345
/// subclass thereof). May also be passed a tuple to search for any exception class matches in
346346
/// the given tuple.
347-
bool matches(handle ex) const { return PyErr_GivenExceptionMatches(ex.ptr(), type.ptr()); }
347+
bool matches(handle exc) const { return PyErr_GivenExceptionMatches(type.ptr(), exc.ptr()); }
348348

349349
private:
350350
object type, value, trace;

0 commit comments

Comments
 (0)