]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
create-spdx: Avoid regex warning by quoting correctly
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 28 Mar 2022 12:29:22 +0000 (13:29 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 29 Mar 2022 14:58:39 +0000 (15:58 +0100)
create-spdx.bbclass:43: DeprecationWarning: invalid escape sequence \W
  lic_regex = re.compile(b'^\W*SPDX-License-Identifier:\s*([ \w\d.()+-]+?)(?:\s+\W*)?$', re.MULTILINE)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/create-spdx.bbclass

index cae8cccd8dc52b599430bb0ff23890bfdf2c56a1..137db81a5b422872394f0ca43dbf86aee7bac908 100644 (file)
@@ -40,7 +40,7 @@ do_image_complete[depends] = "virtual/kernel:do_create_spdx"
 def extract_licenses(filename):
     import re
 
-    lic_regex = re.compile(b'^\W*SPDX-License-Identifier:\s*([ \w\d.()+-]+?)(?:\s+\W*)?$', re.MULTILINE)
+    lic_regex = re.compile(rb'^\W*SPDX-License-Identifier:\s*([ \w\d.()+-]+?)(?:\s+\W*)?$', re.MULTILINE)
 
     try:
         with open(filename, 'rb') as f: