[attributs] On affiche le nom de l'attribut quand on lève une SingleValueError
This commit is contained in:
parent
be97406333
commit
92c4dedfb3
1 changed files with 1 additions and 1 deletions
|
@ -124,7 +124,7 @@ class AttrsDict(dict):
|
|||
values = [ values ]
|
||||
if self._parent.mode in ['w', 'rw']:
|
||||
if CRANS_ATTRIBUTES.get(attr, Attr).singlevalue and len(values) > 1:
|
||||
raise SingleValueError("L'attribut %s doit être monovalué.")
|
||||
raise SingleValueError("L'attribut %s doit être monovalué." % CRANS_ATTRIBUTES.get(attr, Attr).__name__)
|
||||
super(AttrsDict, self).__setitem__(attr, values)
|
||||
else:
|
||||
super(AttrsDict, self).__setitem__(attr, values)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue