From a7d784ba3e555f13df87d7a5b6084edc9902a94b Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sat, 24 Aug 2013 18:04:11 +0200 Subject: [PATCH] is not config in other, __neq__ should return True --- tiramisu/config.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tiramisu/config.py b/tiramisu/config.py index dd0b0f9..ccb806e 100644 --- a/tiramisu/config.py +++ b/tiramisu/config.py @@ -48,8 +48,8 @@ class SubConfig(BaseInformation): """ # main option description if not isinstance(descr, OptionDescription): - raise ValueError(_('descr must be an optiondescription, not {0}' - ).format(type(descr))) + raise TypeError(_('descr must be an optiondescription, not {0}' + ).format(type(descr))) self._impl_descr = descr # sub option descriptions if not isinstance(context, SubConfig): @@ -84,7 +84,7 @@ class SubConfig(BaseInformation): def __ne__(self, other): "Config's comparison" if not isinstance(other, Config): - return False + return True return not self == other # ______________________________________________________________________ @@ -120,9 +120,9 @@ class SubConfig(BaseInformation): or `groups.MasterGroupType` that lives in `setting.groups` """ - if group_type is not None: - if not isinstance(group_type, groups.GroupType): - raise TypeError(_("unknown group_type: {0}").format(group_type)) + if group_type is not None and not isinstance(group_type, + groups.GroupType): + raise TypeError(_("unknown group_type: {0}").format(group_type)) for child in self.cfgimpl_get_description().impl_getchildren(): if isinstance(child, OptionDescription): try: @@ -669,8 +669,6 @@ def mandatory_warnings(config): include_groups=True): try: config._getattr(path, force_properties=frozenset(('mandatory',))) - # XXX raise Exception("ca passe ici") - # XXX depuis l'exterieur on donne un paht maintenant ! perturbant ! except PropertiesOptionError, err: if err.proptype == ['mandatory']: yield path