From 02eb9f166573009f576133a15d6323ff4ab479b1 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 21 Sep 2024 19:57:57 +0200 Subject: buildman: Correct some warnings about regex strings With Python 3.12 some warnings have cropped up. Fix them. Signed-off-by: Simon Glass --- tools/buildman/toolchain.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools/buildman/toolchain.py') diff --git a/tools/buildman/toolchain.py b/tools/buildman/toolchain.py index a7d7883b851..0c8a4fa16eb 100644 --- a/tools/buildman/toolchain.py +++ b/tools/buildman/toolchain.py @@ -440,12 +440,12 @@ class Toolchains: This converts ${blah} within the string to the value of blah. This function works recursively. + Resolved string + Args: var_dict: Dictionary containing variables and their values args: String containing make arguments Returns: - Resolved string - >>> bsettings.setup(None) >>> tcs = Toolchains() >>> tcs.Add('fred', False) @@ -456,7 +456,7 @@ class Toolchains: >>> tcs.ResolveReferences(var_dict, 'this=${oblique}_set${first}nd') 'this=OBLIQUE_setfi2ndrstnd' """ - re_var = re.compile('(\$\{[-_a-z0-9A-Z]{1,}\})') + re_var = re.compile(r'(\$\{[-_a-z0-9A-Z]{1,}\})') while True: m = re_var.search(args) @@ -495,7 +495,7 @@ class Toolchains: self._make_flags['target'] = brd.target arg_str = self.ResolveReferences(self._make_flags, self._make_flags.get(brd.target, '')) - args = re.findall("(?:\".*?\"|\S)+", arg_str) + args = re.findall(r"(?:\".*?\"|\S)+", arg_str) i = 0 while i < len(args): args[i] = args[i].replace('"', '') -- cgit v1.2.3