Virtual method proxies should allow for custom error return behavior
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PyBindGen |
New
|
Undecided
|
Unassigned |
Bug Description
I have a class that periodically gets called from C++, so I'm using a helper class to wrap it. This function is a pure virtual. In this situation, the current behavior when an error occurs seems to be:
If we have a return value that is a wrapped CPP class and it has a trivial constructor, we do nothing.
Otherwise, we call 'PyErr_Print()' then 'Py_FatalError'.
I would rather not exit the process if there is some error in my callback function. In addition, calling 'PyErr_Print' is unsafe, because it is possible for another call to 'PyErr_Print' to be generated here (calling this function twice can cause a crash; this happened to me as well). I was wondering if something could be built in to have custom behavior when an error occurs. I've hacked something in that does what I need, but it's rather simple.