mirror of
https://github.com/RYDE-WORK/pybind11.git
synced 2026-01-19 21:23:26 +08: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…
x
Reference in New Issue
Block a user