summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Freihofer <adrian.freihofer@gmail.com>2024-02-21 20:37:04 +0100
committerSteve Sakoman <steve@sakoman.com>2024-03-01 05:19:54 -1000
commit95b1e23223d64b449eec3bdb35fba23e00e117b9 (patch)
tree230d673b12a9c4fc1cd94d2a4da86385fdfe9de5
parentb8c9a27f06599b05b95720b1667f84e3c0c2836d (diff)
downloadpoky-95b1e23223d64b449eec3bdb35fba23e00e117b9.tar.gz
meta/recipes: python 3.12 regex
Python 3 interprets string literals as Unicode strings, and therefore \s is treated as an escaped Unicode character which is not correct. Declaring the RegEx pattern as a raw string instead of unicode is required for Python 3. (From OE-Core rev: d4e11eebdfe50acc124a87341721a12bc1c15024) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Cherry-picked from master: f2d80817baea298b953d6e14daad65087b3b50c9 Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rwxr-xr-xmeta/recipes-kernel/perf/perf/sort-pmuevents.py8
-rwxr-xr-xmeta/recipes-rt/rt-tests/files/rt_bmark.py2
2 files changed, 5 insertions, 5 deletions
diff --git a/meta/recipes-kernel/perf/perf/sort-pmuevents.py b/meta/recipes-kernel/perf/perf/sort-pmuevents.py
index 0362f2d8fa..0a87e553ab 100755
--- a/meta/recipes-kernel/perf/perf/sort-pmuevents.py
+++ b/meta/recipes-kernel/perf/perf/sort-pmuevents.py
@@ -36,10 +36,10 @@ with open(infile, 'r') as file:
36preamble_regex = re.compile( '^(.*?)^(struct|const struct|static struct|static const struct)', re.MULTILINE | re.DOTALL ) 36preamble_regex = re.compile( '^(.*?)^(struct|const struct|static struct|static const struct)', re.MULTILINE | re.DOTALL )
37 37
38preamble = re.search( preamble_regex, data ) 38preamble = re.search( preamble_regex, data )
39struct_block_regex = re.compile( '^(struct|const struct|static struct|static const struct).*?(\w+) (.*?)\[\] = {(.*?)^};', re.MULTILINE | re.DOTALL ) 39struct_block_regex = re.compile(r'^(struct|const struct|static struct|static const struct).*?(\w+) (.*?)\[\] = {(.*?)^};', re.MULTILINE | re.DOTALL )
40field_regex = re.compile( '{.*?},', re.MULTILINE | re.DOTALL ) 40field_regex = re.compile(r'{.*?},', re.MULTILINE | re.DOTALL )
41cpuid_regex = re.compile( '\.cpuid = (.*?),', re.MULTILINE | re.DOTALL ) 41cpuid_regex = re.compile(r'\.cpuid = (.*?),', re.MULTILINE | re.DOTALL )
42name_regex = re.compile( '\.name = (.*?),', re.MULTILINE | re.DOTALL ) 42name_regex = re.compile(r'\.name = (.*?),', re.MULTILINE | re.DOTALL )
43 43
44# create a dictionary structure to store all the structs, their 44# create a dictionary structure to store all the structs, their
45# types and then their fields. 45# types and then their fields.
diff --git a/meta/recipes-rt/rt-tests/files/rt_bmark.py b/meta/recipes-rt/rt-tests/files/rt_bmark.py
index 3b84447a0f..2a4eed412f 100755
--- a/meta/recipes-rt/rt-tests/files/rt_bmark.py
+++ b/meta/recipes-rt/rt-tests/files/rt_bmark.py
@@ -265,7 +265,7 @@ cmd = ("cyclictest",
265 "-d", str(interval_delta), 265 "-d", str(interval_delta),
266 "-l", str(loop_count) 266 "-l", str(loop_count)
267 ) 267 )
268rex = re.compile(b"C:\s*(\d+).*Min:\s*(\d+).*Avg:\s*(\d+).*Max:\s*(\d+)") 268rex = re.compile(r"C:\s*(\d+).*Min:\s*(\d+).*Avg:\s*(\d+).*Max:\s*(\d+)")
269 269
270def run_cyclictest_once(): 270def run_cyclictest_once():
271 res = subprocess.check_output(cmd) 271 res = subprocess.check_output(cmd)