Use __attrs_post_init__ to validate ArgInfo
This makes qutebrowser compatible with attrs < 17.1.0, such as attrs 16.3.0 coming with Debian Stretch.
This commit is contained in:
parent
31bd4d7ffe
commit
9d360f80cf
@ -45,9 +45,7 @@ class ArgInfo:
|
||||
completion = attr.ib(None)
|
||||
choices = attr.ib(None)
|
||||
|
||||
@win_id.validator
|
||||
@count.validator
|
||||
def _validate_exclusive(self, _attr, _value):
|
||||
def __attrs_post_init__(self):
|
||||
if self.win_id and self.count:
|
||||
raise TypeError("Argument marked as both count/win_id!")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user