Skip to content

Commit b3e190c

Browse files
committed
Fixing order of arguments in call to PyErr_GivenExceptionMatches in pybind11::error_already_set.matches
1 parent 35045ee commit b3e190c

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(), m_type.ptr()); }
347+
bool matches(handle exc) const { return PyErr_GivenExceptionMatches(m_type.ptr(), exc.ptr()); }
348348

349349
const object& type() const { return m_type; }
350350
const object& value() const { return m_value; }

0 commit comments

Comments
 (0)