summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2023-11-20 08:27:07 +0000
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2023-11-21 02:48:34 +0000
commit1aba1df643f9a8a4e2121de80aafd2bb91031060 (patch)
tree4a8257f2df3a5e83ecd6d81b27d687e6ea6e8c8c
parent6788ff0c02220132fc9639b8dc7397d856845a4a (diff)
cerbero: Fix some more python 3.12 string escape warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1310>
-rw-r--r--cerbero/build/build.py4
-rw-r--r--cerbero/build/filesprovider.py2
-rw-r--r--cerbero/ide/vs/props.py2
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<name>[^']+)')\s*,\s*(?P<entry>(?P<identifier>[a-zA-Z0-9]+)\s*:\s*(?:(?P<string>'[^']+')|[^'\),\s]+)\s*,?\s*)+\)"
+ option_regex = r"option\s*\(\s*(?:'(?P<name>[^']+)')\s*,\s*(?P<entry>(?P<identifier>[a-zA-Z0-9]+)\s*:\s*(?:(?P<string>'[^']+')|[^'\),\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>[^']+)'"
+ type_regex = r"type\s*:\s*'(?P<type>[^']+)'"
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()