exceptions raised in get/set_properties are not trapped by try/except
Submitted by san..@..den.it
Link to original bug (#575652)
Description
Please describe the problem: As the following code shows, a try/except will not trap an error raised by within a get_property
Steps to reproduce:
import gobject
class MyError(Exception): pass
class Test(gobject.GObject):
__gproperties__ = {
'date' : (gobject.TYPE_PYOBJECT, # type
'Date', # nick name
'The date currently selected', # description
gobject.PARAM_READWRITE), # flags
}
def get_date(self):
raise MyError("Gulp!")
def do_get_property(self, property):
if property.name == 'date':
return self.get_date()
t = Test()
try:
t.get_property('date') # this will raise MyError
except: # this will not catch it!!!!
pass
Actual results:
Expected results: I'd expect try/except to catch all normal errors. I asked in several list and no one expected this behaviour or answered that this is correct
Does this happen every time? yes, also teted it in ubuntu 8.10 (pygobject 2.15.3
Other information:
Depends on
Edited by Christoph Reiter