Safer version of the parent hack

not all objects have a bindable parent, Timer fe have Loop as parent and we don't have bindings for Loop.
This commit is contained in:
Davide Andreoli 2016-05-29 15:49:17 +02:00
parent c2c09d4dc9
commit 7fd0f973ca
1 changed files with 5 additions and 1 deletions

View File

@ -258,7 +258,11 @@ cdef class Eo(object):
# from efl 1.18 eo.parent changed behaviour, objects are now reparented
# when, fe, swallowed. This is the hack to keep the old behavior.
self.internal_data["_legacy_parent"] = object_from_instance(eo_parent_get(obj))
try:
parent = object_from_instance(eo_parent_get(obj))
except ValueError:
parent = None
self.internal_data["_legacy_parent"] = parent
return 1