mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-21 20:55:11 +00:00
docs: fix example code in Exceptions section (match vs. matches) (#2781)
This commit is contained in:
parent
210c8c218f
commit
14b375123c
@ -196,7 +196,7 @@ For example:
|
||||
} catch (py::error_already_set &e) {
|
||||
if (e.matches(PyExc_FileNotFoundError)) {
|
||||
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");
|
||||
} else {
|
||||
throw;
|
||||
|
Loading…
Reference in New Issue
Block a user