can't assign to an OptionDescription

This commit is contained in:
2013-09-26 22:35:12 +02:00
parent 1d2008fd84
commit 3073940ca4
3 changed files with 23 additions and 13 deletions

View File

@ -185,7 +185,9 @@ class SubConfig(object):
homeconfig, name = self.cfgimpl_get_home_by_path(name)
return homeconfig.__setattr__(name, value)
child = getattr(self.cfgimpl_get_description(), name)
if not isinstance(child, SymLinkOption):
if isinstance(child, OptionDescription):
raise SyntaxError(_("can't assign to an OptionDescription"))
elif not isinstance(child, SymLinkOption):
if self._impl_path is None:
path = name
else: