diff options
author | Adrian Freihofer <adrian.freihofer@gmail.com> | 2024-02-10 14:15:59 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-13 13:51:41 +0000 |
commit | 83d5c123d3c509f6ad00492b4f00f73474e89842 (patch) | |
tree | 8ed6d806ec88a0dde6645da72c91b811fe46af81 /meta/recipes-kernel | |
parent | fe58da13930638037283f9a96fc103835b15f919 (diff) | |
download | poky-83d5c123d3c509f6ad00492b4f00f73474e89842.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: f2d80817baea298b953d6e14daad65087b3b50c9)
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel')
-rwxr-xr-x | meta/recipes-kernel/perf/perf/sort-pmuevents.py | 8 |
1 files changed, 4 insertions, 4 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: | |||
36 | preamble_regex = re.compile( '^(.*?)^(struct|const struct|static struct|static const struct)', re.MULTILINE | re.DOTALL ) | 36 | preamble_regex = re.compile( '^(.*?)^(struct|const struct|static struct|static const struct)', re.MULTILINE | re.DOTALL ) |
37 | 37 | ||
38 | preamble = re.search( preamble_regex, data ) | 38 | preamble = re.search( preamble_regex, data ) |
39 | struct_block_regex = re.compile( '^(struct|const struct|static struct|static const struct).*?(\w+) (.*?)\[\] = {(.*?)^};', re.MULTILINE | re.DOTALL ) | 39 | struct_block_regex = re.compile(r'^(struct|const struct|static struct|static const struct).*?(\w+) (.*?)\[\] = {(.*?)^};', re.MULTILINE | re.DOTALL ) |
40 | field_regex = re.compile( '{.*?},', re.MULTILINE | re.DOTALL ) | 40 | field_regex = re.compile(r'{.*?},', re.MULTILINE | re.DOTALL ) |
41 | cpuid_regex = re.compile( '\.cpuid = (.*?),', re.MULTILINE | re.DOTALL ) | 41 | cpuid_regex = re.compile(r'\.cpuid = (.*?),', re.MULTILINE | re.DOTALL ) |
42 | name_regex = re.compile( '\.name = (.*?),', re.MULTILINE | re.DOTALL ) | 42 | name_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. |