mirror of
https://github.com/ceph/ceph
synced 2025-03-29 23:09:47 +00:00
python-common: fix variable name reuse to make mypy happy
The variables high and low were being used as both `str`s and regex match objects. Rename the vars in the if block to avoid this problem. This change makes this file pass mypy checking on mypy 0.981. Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
parent
3035ca6c52
commit
f2646dbaba
@ -313,10 +313,10 @@ class SizeMatcher(Matcher):
|
||||
and raises if none could be found.
|
||||
"""
|
||||
low_high = re.match(r"\d+[A-Z]{1,2}:\d+[A-Z]{1,2}", self.value)
|
||||
if low_high:
|
||||
low, high = low_high.group().split(":")
|
||||
self.low = self._get_k_v(low)
|
||||
self.high = self._get_k_v(high)
|
||||
if low_high is not None:
|
||||
lowpart, highpart = low_high.group().split(":")
|
||||
self.low = self._get_k_v(lowpart)
|
||||
self.high = self._get_k_v(highpart)
|
||||
|
||||
low = re.match(r"\d+[A-Z]{1,2}:$", self.value)
|
||||
if low:
|
||||
|
Loading…
Reference in New Issue
Block a user