is not config in other, __neq__ should return True

This commit is contained in:
Emmanuel Garette 2013-08-24 18:04:11 +02:00
parent 196d270cc9
commit a7d784ba3e
1 changed files with 6 additions and 8 deletions

View File

@ -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