Find breaks on "disabled" property
authorDaniel Dehennin <daniel.dehennin@ac-dijon.fr>
Thu, 31 Jan 2013 13:38:48 +0000 (14:38 +0100)
committerDaniel Dehennin <daniel.dehennin@ac-dijon.fr>
Thu, 31 Jan 2013 13:38:48 +0000 (14:38 +0100)
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

tiramisu/config.py

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