From 1aba1df643f9a8a4e2121de80aafd2bb91031060 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Mon, 20 Nov 2023 08:27:07 +0000 Subject: cerbero: Fix some more python 3.12 string escape warnings Part-of: --- cerbero/build/build.py | 4 ++-- cerbero/build/filesprovider.py | 2 +- cerbero/ide/vs/props.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cerbero/build/build.py b/cerbero/build/build.py index 8f7c2fb1..955661ff 100644 --- a/cerbero/build/build.py +++ b/cerbero/build/build.py @@ -821,14 +821,14 @@ class Meson (Build, ModifyEnvBase) : with open(meson_options, 'r', encoding='utf-8') as f: options = f.read() # iterate over all option()s individually - option_regex = "option\s*\(\s*(?:'(?P[^']+)')\s*,\s*(?P(?P[a-zA-Z0-9]+)\s*:\s*(?:(?P'[^']+')|[^'\),\s]+)\s*,?\s*)+\)" + option_regex = r"option\s*\(\s*(?:'(?P[^']+)')\s*,\s*(?P(?P[a-zA-Z0-9]+)\s*:\s*(?:(?P'[^']+')|[^'\),\s]+)\s*,?\s*)+\)" for match in re.finditer(option_regex, options, re.MULTILINE): option = match.group(0) # find the option(), if it exists opt_name = match.group('name') if opt_name in opt_names: # get the type of the option - type_regex = "type\s*:\s*'(?P[^']+)'" + type_regex = r"type\s*:\s*'(?P[^']+)'" ty = re.search (type_regex, option, re.MULTILINE) if ty: if ty.group('type') in ('feature', 'boolean'): diff --git a/cerbero/build/filesprovider.py b/cerbero/build/filesprovider.py index fcd5569f..21ffe44f 100644 --- a/cerbero/build/filesprovider.py +++ b/cerbero/build/filesprovider.py @@ -452,7 +452,7 @@ class FilesProvider(object): return f else: pydir = os.path.basename(os.path.normpath(self.py_prefix)) - pyversioname = re.sub("python|\.", '', pydir) + pyversioname = re.sub(r"python|\.", '', pydir) cpythonname = "cpython-" + pyversioname splitedext = os.path.splitext(f) diff --git a/cerbero/ide/vs/props.py b/cerbero/ide/vs/props.py index 1c6c1045..65e21d44 100644 --- a/cerbero/ide/vs/props.py +++ b/cerbero/ide/vs/props.py @@ -109,7 +109,7 @@ class CommonProps(PropsBase): self._add_root() self._add_skeleton() self._add_compiler_props() - self._add_include_dirs(['$(%s)\include' % prefix_macro]) + self._add_include_dirs([r'$(%s)\include' % prefix_macro]) self._add_imported_variable() -- cgit v1.2.3