mirror of
https://xff.cz/git/u-boot/
synced 2025-09-28 14:01:16 +02:00
buildman: Correct some warnings about regex strings
With Python 3.12 some warnings have cropped up. Fix them. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -34,7 +34,7 @@ from u_boot_pylib.terminal import tprint
|
|||||||
# Error in reading or end of file.
|
# Error in reading or end of file.
|
||||||
# <<
|
# <<
|
||||||
# which indicates that BREAK_ME has an empty default
|
# which indicates that BREAK_ME has an empty default
|
||||||
RE_NO_DEFAULT = re.compile(b'\((\w+)\) \[] \(NEW\)')
|
RE_NO_DEFAULT = re.compile(br'\((\w+)\) \[] \(NEW\)')
|
||||||
|
|
||||||
# Symbol types which appear in the bloat feature (-B). Others are silently
|
# Symbol types which appear in the bloat feature (-B). Others are silently
|
||||||
# dropped when reading in the 'nm' output
|
# dropped when reading in the 'nm' output
|
||||||
@@ -374,9 +374,9 @@ class Builder:
|
|||||||
|
|
||||||
self._re_function = re.compile('(.*): In function.*')
|
self._re_function = re.compile('(.*): In function.*')
|
||||||
self._re_files = re.compile('In file included from.*')
|
self._re_files = re.compile('In file included from.*')
|
||||||
self._re_warning = re.compile('(.*):(\d*):(\d*): warning: .*')
|
self._re_warning = re.compile(r'(.*):(\d*):(\d*): warning: .*')
|
||||||
self._re_dtb_warning = re.compile('(.*): Warning .*')
|
self._re_dtb_warning = re.compile('(.*): Warning .*')
|
||||||
self._re_note = re.compile('(.*):(\d*):(\d*): note: this is the location of the previous.*')
|
self._re_note = re.compile(r'(.*):(\d*):(\d*): note: this is the location of the previous.*')
|
||||||
self._re_migration_warning = re.compile(r'^={21} WARNING ={22}\n.*\n=+\n',
|
self._re_migration_warning = re.compile(r'^={21} WARNING ={22}\n.*\n=+\n',
|
||||||
re.MULTILINE | re.DOTALL)
|
re.MULTILINE | re.DOTALL)
|
||||||
|
|
||||||
|
@@ -440,12 +440,12 @@ class Toolchains:
|
|||||||
This converts ${blah} within the string to the value of blah.
|
This converts ${blah} within the string to the value of blah.
|
||||||
This function works recursively.
|
This function works recursively.
|
||||||
|
|
||||||
|
Resolved string
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
var_dict: Dictionary containing variables and their values
|
var_dict: Dictionary containing variables and their values
|
||||||
args: String containing make arguments
|
args: String containing make arguments
|
||||||
Returns:
|
Returns:
|
||||||
Resolved string
|
|
||||||
|
|
||||||
>>> bsettings.setup(None)
|
>>> bsettings.setup(None)
|
||||||
>>> tcs = Toolchains()
|
>>> tcs = Toolchains()
|
||||||
>>> tcs.Add('fred', False)
|
>>> tcs.Add('fred', False)
|
||||||
@@ -456,7 +456,7 @@ class Toolchains:
|
|||||||
>>> tcs.ResolveReferences(var_dict, 'this=${oblique}_set${first}nd')
|
>>> tcs.ResolveReferences(var_dict, 'this=${oblique}_set${first}nd')
|
||||||
'this=OBLIQUE_setfi2ndrstnd'
|
'this=OBLIQUE_setfi2ndrstnd'
|
||||||
"""
|
"""
|
||||||
re_var = re.compile('(\$\{[-_a-z0-9A-Z]{1,}\})')
|
re_var = re.compile(r'(\$\{[-_a-z0-9A-Z]{1,}\})')
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
m = re_var.search(args)
|
m = re_var.search(args)
|
||||||
@@ -495,7 +495,7 @@ class Toolchains:
|
|||||||
self._make_flags['target'] = brd.target
|
self._make_flags['target'] = brd.target
|
||||||
arg_str = self.ResolveReferences(self._make_flags,
|
arg_str = self.ResolveReferences(self._make_flags,
|
||||||
self._make_flags.get(brd.target, ''))
|
self._make_flags.get(brd.target, ''))
|
||||||
args = re.findall("(?:\".*?\"|\S)+", arg_str)
|
args = re.findall(r"(?:\".*?\"|\S)+", arg_str)
|
||||||
i = 0
|
i = 0
|
||||||
while i < len(args):
|
while i < len(args):
|
||||||
args[i] = args[i].replace('"', '')
|
args[i] = args[i].replace('"', '')
|
||||||
|
Reference in New Issue
Block a user