mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 06:35:12 +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) {
|
} 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;
|
||||||
|
Loading…
Reference in New Issue
Block a user