Minor tweaks about code quality.

This commit is contained in:
Romain Dorgueil
2018-07-16 10:00:28 +02:00
parent d9f2fd3009
commit 6a1203602f
9 changed files with 9 additions and 15 deletions

View File

@ -52,7 +52,7 @@ class Setting:
def set(self, value):
value = self.formatter(value) if self.formatter else value
if self.validator and not self.validator(value):
raise ValidationError('Invalid value {!r} for setting {}.'.format(value, self.name))
raise ValidationError(self, 'Invalid value {!r} for setting {!r}.'.format(value, self.name))
self.value = value
def set_if_true(self, value):