forked from Mirror/pmbootstrap
pmb: Use raw strings for regexes (MR 2525)
See https://docs.astral.sh/ruff/rules/unraw-re-pattern
This commit is contained in:
parent
077efe3623
commit
d6f0c80431
2 changed files with 2 additions and 2 deletions
|
@ -15,7 +15,7 @@ def indent_size(line: str) -> int:
|
|||
"""
|
||||
Number of spaces at the beginning of a string.
|
||||
"""
|
||||
matches = re.findall("^[ ]*", line)
|
||||
matches = re.findall(r"^[ ]*", line)
|
||||
if len(matches) == 1:
|
||||
return len(matches[0])
|
||||
return 0
|
||||
|
|
|
@ -301,7 +301,7 @@ def resize_image(img_size_new: str, img_path: Path) -> None:
|
|||
img_size = os.path.getsize(img_path)
|
||||
|
||||
# Make sure we have at least 1 integer followed by either M or G
|
||||
pattern = re.compile("^[0-9]+[M|G]$")
|
||||
pattern = re.compile(r"^[0-9]+[M|G]$")
|
||||
if not pattern.match(img_size_new):
|
||||
raise RuntimeError("IMAGE_SIZE must be in [M]iB or [G]iB, e.g. 2048M or 2G")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue