Explorar el Código

create-spdx: Avoid regex warning by quoting correctly

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)

(From OE-Core rev: 5dfb26d45f69c4d5dc4b6fcef084b830ef9dbf4c)

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>
Richard Purdie hace 3 años
padre
commit
c80a6a6e66
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      meta/classes/create-spdx.bbclass

+ 1 - 1
meta/classes/create-spdx.bbclass

@@ -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: