Virtual method proxies should allow for custom error return behavior

Bug #1083959 reported by Max Bélanger
6
This bug affects 1 person
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.

Revision history for this message
Max Bélanger (aeromax) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.