mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
handle Python exceptions properly in get_context()
This commit is contained in:
parent
ee3adf5723
commit
3c65b5171b
@ -31,7 +31,14 @@
|
||||
////////////////////////////////////////////////////////////////////
|
||||
PyObject* EXT_CONST_METHOD(RocketRegion,
|
||||
get_context) {
|
||||
Rocket::Core::Context* context = _ext_this->get_context();
|
||||
python::object py_context = Rocket::Core::Python::Utilities::MakeObject(context);
|
||||
python::object py_context;
|
||||
|
||||
try {
|
||||
Rocket::Core::Context* context = _ext_this->get_context();
|
||||
py_context = Rocket::Core::Python::Utilities::MakeObject(context);
|
||||
} catch (const python::error_already_set& e) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return py_context.ptr();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user