diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2023-11-15 15:20:24 +0000 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2023-11-15 17:34:54 +0000 |
commit | fb3e0a57d112c43e5cc94e1b4464a74c5f385dcc (patch) | |
tree | f11ad04bab11b71c371a507445909c7d1e710629 | |
parent | 23e44070ea832081b5fdb249428ad1d36bec48a4 (diff) |
cerbero: Fix some warnings about escaping with Python 3.12
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1301>
-rw-r--r-- | cerbero/packages/wix.py | 2 | ||||
-rw-r--r-- | cerbero/utils/__init__.py | 4 | ||||
-rw-r--r-- | cerbero/utils/shell.py | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/cerbero/packages/wix.py b/cerbero/packages/wix.py index 3c053ae4..92e5a79f 100644 --- a/cerbero/packages/wix.py +++ b/cerbero/packages/wix.py @@ -651,7 +651,7 @@ class MSI(WixBase): etree.SubElement(apps, 'RemoveFolder', Id='ApplicationProgramsFolder', On='uninstall') etree.SubElement(apps, 'RegistryValue', Root='HKCU', - Key='Software\Microsoft\%s' % self.package.name, + Key=r'Software\Microsoft\%s' % self.package.name, Name='installed', Type='integer', Value='1', KeyPath='yes') # Ref it in the main feature etree.SubElement(self.main_feature, 'ComponentRef', diff --git a/cerbero/utils/__init__.py b/cerbero/utils/__init__.py index d5725dcd..624a461e 100644 --- a/cerbero/utils/__init__.py +++ b/cerbero/utils/__init__.py @@ -470,8 +470,8 @@ def parse_file(filename, dict): def escape_path(path): path = path.replace('\\', '/') - path = path.replace('(', '\\\(').replace(')', '\\\)') - path = path.replace(' ', '\\\\ ') + path = path.replace('(', r'\\(').replace(')', r'\\)') + path = path.replace(' ', r'\\ ') return path diff --git a/cerbero/utils/shell.py b/cerbero/utils/shell.py index 50f99c64..a47347cf 100644 --- a/cerbero/utils/shell.py +++ b/cerbero/utils/shell.py @@ -679,7 +679,7 @@ def check_tool_version(tool_name, needed, env, version_arg=None): out = check_output([tool, version_arg], env=env) except FatalError: return None, False, False - m = re.search('([0-9]+\.[0-9]+(\.[0-9]+)?)', out) + m = re.search(r'([0-9]+\.[0-9]+(\.[0-9]+)?)', out) if m: found = m.groups()[0] newer = StrictVersion(found) >= StrictVersion(needed) |