We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a98bfe4 commit 16066f3Copy full SHA for 16066f3
include/cpp2py/py_converter.hpp
@@ -63,9 +63,11 @@ namespace cpp2py {
63
}
64
65
// Return ptr from __cpp2py_table attribute if available
66
+ if(not PyObject_HasAttrString(mod, "__cpp2py_table"))
67
+ return {};
68
pyref capsule = PyObject_GetAttrString(mod, "__cpp2py_table");
69
if(capsule.is_null())
- return {};
70
+ throw std::runtime_error("Severe internal error : can not load __main__.__cpp2py_table");
71
void * ptr = PyCapsule_GetPointer(capsule, "__main__.__cpp2py_table");
72
return {*static_cast<std::shared_ptr<conv_table_t> *>(ptr)};
73
0 commit comments