diff options
author | Adrian Freihofer <adrian.freihofer@gmail.com> | 2024-02-10 14:15:54 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-13 13:51:41 +0000 |
commit | 605ef6f5a292fe169b1469b0a8996f3d5ae53daf (patch) | |
tree | 68ea616c466ade988cc324256d012e1ec6501942 /scripts/contrib/bbvars.py | |
parent | 97eebe59d7ba9d7eb647a2f2a0353fc2424e9827 (diff) | |
download | poky-605ef6f5a292fe169b1469b0a8996f3d5ae53daf.tar.gz |
scripts: python 3.12 regex
All the regexes throw a warning like this:
WARNING: scripts/lib/recipetool/create_buildsys.py:140:
SyntaxWarning: invalid escape sequence '\s'
proj_re = re.compile('project\s*\(([^)]*)\)', re.IGNORECASE)
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: 24b0ba00d4f0b4d9834f7693ecb6032dfc534a80)
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/contrib/bbvars.py')
-rwxr-xr-x | scripts/contrib/bbvars.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/contrib/bbvars.py b/scripts/contrib/bbvars.py index 090133600b..a9cdf082ab 100755 --- a/scripts/contrib/bbvars.py +++ b/scripts/contrib/bbvars.py | |||
@@ -36,8 +36,8 @@ def bbvar_is_documented(var, documented_vars): | |||
36 | def collect_documented_vars(docfiles): | 36 | def collect_documented_vars(docfiles): |
37 | ''' Walk the docfiles and collect the documented variables ''' | 37 | ''' Walk the docfiles and collect the documented variables ''' |
38 | documented_vars = [] | 38 | documented_vars = [] |
39 | prog = re.compile(".*($|[^A-Z_])<glossentry id=\'var-") | 39 | prog = re.compile(r".*($|[^A-Z_])<glossentry id=\'var-") |
40 | var_prog = re.compile('<glossentry id=\'var-(.*)\'>') | 40 | var_prog = re.compile(r'<glossentry id=\'var-(.*)\'>') |
41 | for d in docfiles: | 41 | for d in docfiles: |
42 | with open(d) as f: | 42 | with open(d) as f: |
43 | documented_vars += var_prog.findall(f.read()) | 43 | documented_vars += var_prog.findall(f.read()) |
@@ -45,7 +45,7 @@ def collect_documented_vars(docfiles): | |||
45 | return documented_vars | 45 | return documented_vars |
46 | 46 | ||
47 | def bbvar_doctag(var, docconf): | 47 | def bbvar_doctag(var, docconf): |
48 | prog = re.compile('^%s\[doc\] *= *"(.*)"' % (var)) | 48 | prog = re.compile(r'^%s\[doc\] *= *"(.*)"' % (var)) |
49 | if docconf == "": | 49 | if docconf == "": |
50 | return "?" | 50 | return "?" |
51 | 51 | ||