Merge pull request #2317 from matham/lang-except

Ignore key exceptions when binding kv rules.
This commit is contained in:
Akshay Arora 2014-07-07 04:26:15 +05:30
commit d840d6ecb0
1 changed files with 11 additions and 6 deletions

View File

@ -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:
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.
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)