Commit 14b37512 by Andy Maloney Committed by GitHub

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

parent 210c8c21
...@@ -196,7 +196,7 @@ For example: ...@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment