Add missing error handling to module_::def_submodule (#3973)

* Add missing error handling to module_::def_submodule

* Add test_def_submodule_failures

* PyPy only: Skip test with trigger for PyModule_GetName() failure.

* Reapply minor fix that accidentally got lost in transfer from PR #3964
This commit is contained in:
Ralf W. Grosse-Kunstleve
2022-05-28 16:40:57 -07:00
committed by GitHub
parent 68f8010500
commit 748ae2270b
3 changed files with 42 additions and 3 deletions

View File

@@ -120,4 +120,6 @@ TEST_SUBMODULE(modules, m) {
return failures;
});
m.def("def_submodule", [](py::module_ m, const char *name) { return m.def_submodule(name); });
}