mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 20:22:45 +01:00
registry.Regexp: Better safeguard against misuses of _setValue()
This commit is contained in:
parent
28b28fe3cf
commit
1643cb1b09
@ -802,16 +802,14 @@ class Regexp(Value):
|
||||
else:
|
||||
super().set(v)
|
||||
|
||||
def setValue(self, v):
|
||||
"""Don't call this function directly from plugins, it is subject
|
||||
to change without notice."""
|
||||
def _setValue(self, v, *args, **kwargs):
|
||||
if v is not None and (not isinstance(v, tuple) or len(v) != 2):
|
||||
raise InvalidRegistryValue(
|
||||
'Can\'t setValue a regexp, there would be an inconsistency '
|
||||
'between the regexp and the recorded string value. '
|
||||
'Use .set() instead.')
|
||||
|
||||
super().setValue(v)
|
||||
super()._setValue(v, *args, **kwargs)
|
||||
|
||||
def __call__(self):
|
||||
value = super().__call__()
|
||||
|
Loading…
Reference in New Issue
Block a user