docs: fix example code in Exceptions section (match vs. matches) (#2781)

This commit is contained in:
Andy Maloney 2021-01-13 23:14:45 -05:00 committed by GitHub
parent 210c8c218f
commit 14b375123c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -196,7 +196,7 @@ For example:
} catch (py::error_already_set &e) { } catch (py::error_already_set &e) {
if (e.matches(PyExc_FileNotFoundError)) { if (e.matches(PyExc_FileNotFoundError)) {
py::print("missing.txt not found"); py::print("missing.txt not found");
} else if (e.match(PyExc_PermissionError)) { } else if (e.matches(PyExc_PermissionError)) {
py::print("missing.txt found but not accessible"); py::print("missing.txt found but not accessible");
} else { } else {
throw; throw;