From 94d7a7232c371b4a06f3caf86055fd52bfb820ef Mon Sep 17 00:00:00 2001 From: Matthew Einhorn Date: Sun, 6 Jul 2014 14:34:07 -0400 Subject: [PATCH] Ignore key exceptions when binding kv rules. --- kivy/lang.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/kivy/lang.py b/kivy/lang.py index 4389b6be1..b0af95a5f 100755 --- a/kivy/lang.py +++ b/kivy/lang.py @@ -1547,12 +1547,17 @@ def create_handler(iself, element, key, value, rule, idmap, delayed=False): # bind every key.value if rule.watched_keys is not None: for keys in rule.watched_keys: - bound = [] - update_intermediates(get_proxy(idmap[keys[0]]), keys, bound, None, - fn) - # even if it's empty now, in the future, through dynamic rebinding - # it might have things. - _handlers[uid].append(bound) + try: + bound = [] + update_intermediates(get_proxy(idmap[keys[0]]), keys, bound, + None, fn) + # even if it's empty now, in the future, through dynamic + # rebinding it might have things. + _handlers[uid].append(bound) + except KeyError: + continue + except AttributeError: + continue try: return eval(value, idmap)