Find breaks on "disabled" property

The exception was raised during unwrap_from_path() call.

* tiramisu/config.py (_filter_by_attrs): do not catch exception arround
  getattr().
  (_find): continue to next option if unwrap_from_path() raise
  PropertiesOptionError.

Fixes: #4728 @5m
This commit is contained in:
Daniel Dehennin 2013-01-31 14:38:48 +01:00
parent f494bb1502
commit 170698a5e3
1 changed files with 6 additions and 6 deletions

View File

@ -556,11 +556,8 @@ class Config(object):
if not hasattr(option, key): if not hasattr(option, key):
return False return False
else: else:
try:
if getattr(option, key) != value: if getattr(option, key) != value:
return False return False
except:
pass # a property restricts the access of the value
else: else:
continue continue
return True return True
@ -592,7 +589,10 @@ class Config(object):
find_results = [] find_results = []
paths = self.getpaths(allpaths=True) paths = self.getpaths(allpaths=True)
for path in paths: for path in paths:
try:
option = self.unwrap_from_path(path) option = self.unwrap_from_path(path)
except PropertiesOptionError, err:
continue
if not _filter_by_name(): if not _filter_by_name():
continue continue
if not _filter_by_value(): if not _filter_by_value():