mirror of https://github.com/kivy/kivy.git
Merge pull request #2317 from matham/lang-except
Ignore key exceptions when binding kv rules.
This commit is contained in:
commit
d840d6ecb0
13
kivy/lang.py
13
kivy/lang.py
|
@ -1547,12 +1547,17 @@ def create_handler(iself, element, key, value, rule, idmap, delayed=False):
|
||||||
# bind every key.value
|
# bind every key.value
|
||||||
if rule.watched_keys is not None:
|
if rule.watched_keys is not None:
|
||||||
for keys in rule.watched_keys:
|
for keys in rule.watched_keys:
|
||||||
|
try:
|
||||||
bound = []
|
bound = []
|
||||||
update_intermediates(get_proxy(idmap[keys[0]]), keys, bound, None,
|
update_intermediates(get_proxy(idmap[keys[0]]), keys, bound,
|
||||||
fn)
|
None, fn)
|
||||||
# even if it's empty now, in the future, through dynamic rebinding
|
# even if it's empty now, in the future, through dynamic
|
||||||
# it might have things.
|
# rebinding it might have things.
|
||||||
_handlers[uid].append(bound)
|
_handlers[uid].append(bound)
|
||||||
|
except KeyError:
|
||||||
|
continue
|
||||||
|
except AttributeError:
|
||||||
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return eval(value, idmap)
|
return eval(value, idmap)
|
||||||
|
|
Loading…
Reference in New Issue