mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-26 04:32:51 +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:
|
else:
|
||||||
super().set(v)
|
super().set(v)
|
||||||
|
|
||||||
def setValue(self, v):
|
def _setValue(self, v, *args, **kwargs):
|
||||||
"""Don't call this function directly from plugins, it is subject
|
|
||||||
to change without notice."""
|
|
||||||
if v is not None and (not isinstance(v, tuple) or len(v) != 2):
|
if v is not None and (not isinstance(v, tuple) or len(v) != 2):
|
||||||
raise InvalidRegistryValue(
|
raise InvalidRegistryValue(
|
||||||
'Can\'t setValue a regexp, there would be an inconsistency '
|
'Can\'t setValue a regexp, there would be an inconsistency '
|
||||||
'between the regexp and the recorded string value. '
|
'between the regexp and the recorded string value. '
|
||||||
'Use .set() instead.')
|
'Use .set() instead.')
|
||||||
|
|
||||||
super().setValue(v)
|
super()._setValue(v, *args, **kwargs)
|
||||||
|
|
||||||
def __call__(self):
|
def __call__(self):
|
||||||
value = super().__call__()
|
value = super().__call__()
|
||||||
|
Loading…
Reference in New Issue
Block a user