Skip to content

Commit

Permalink
kernel-balena.bbclass: silence regex escape warnings
Browse files Browse the repository at this point in the history
This patch converts the regex strings to raw strings to silence
`DeprecationWarning: invalid escape sequence \d`

Change-type: patch
Signed-off-by: Michal Toman <michalt@balena.io>
  • Loading branch information
mtoman committed Jan 27, 2025
1 parent 41f3921 commit a9e70b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions meta-balena-common/classes/kernel-balena.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,16 @@ def get_kernel_version(d):

kernelversion = ""
for s in lines:
m = re.match("VERSION = (\d+)", s)
m = re.match(r"VERSION = (\d+)", s)
if m:
kernelversion = kernelversion + m.group(1)
m = re.match("PATCHLEVEL = (\d+)", s)
m = re.match(r"PATCHLEVEL = (\d+)", s)
if m:
kernelversion = kernelversion + '.' + m.group(1)
m = re.match("SUBLEVEL = (\d+)", s)
m = re.match(r"SUBLEVEL = (\d+)", s)
if m:
kernelversion = kernelversion + '.' + m.group(1)
m = re.match("EXTRAVERSION = (\d+)", s)
m = re.match(r"EXTRAVERSION = (\d+)", s)
if m:
kernelversion = kernelversion + '.' + m.group(1)
return kernelversion
Expand Down

0 comments on commit a9e70b3

Please sign in to comment.