[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/32] tracetool: avoid invalid escape in Python string
|
From: |
Paolo Bonzini |
|
Subject: |
[PULL 14/32] tracetool: avoid invalid escape in Python string |
|
Date: |
Wed, 18 Oct 2023 10:27:34 +0200 |
This is an error in Python 3.12; fix it by using a raw string literal.
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
scripts/tracetool/__init__.py | 14 +++++++-------
scripts/tracetool/format/log_stap.py | 2 +-
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py
index 33cf85e2b04..b29594d75e0 100644
--- a/scripts/tracetool/__init__.py
+++ b/scripts/tracetool/__init__.py
@@ -210,12 +210,12 @@ class Event(object):
"""
- _CRE = re.compile("((?P<props>[\w\s]+)\s+)?"
- "(?P<name>\w+)"
- "\((?P<args>[^)]*)\)"
- "\s*"
- "(?:(?:(?P<fmt_trans>\".+),)?\s*(?P<fmt>\".+))?"
- "\s*")
+ _CRE = re.compile(r"((?P<props>[\w\s]+)\s+)?"
+ r"(?P<name>\w+)"
+ r"\((?P<args>[^)]*)\)"
+ r"\s*"
+ r"(?:(?:(?P<fmt_trans>\".+),)?\s*(?P<fmt>\".+))?"
+ r"\s*")
_VALID_PROPS = set(["disable", "vcpu"])
@@ -326,7 +326,7 @@ def __repr__(self):
fmt)
# Star matching on PRI is dangerous as one might have multiple
# arguments with that format, hence the non-greedy version of it.
- _FMT = re.compile("(%[\d\.]*\w+|%.*?PRI\S+)")
+ _FMT = re.compile(r"(%[\d\.]*\w+|%.*?PRI\S+)")
def formats(self):
"""List conversion specifiers in the argument print format string."""
diff --git a/scripts/tracetool/format/log_stap.py
b/scripts/tracetool/format/log_stap.py
index 0b6549d534a..b49afababd6 100644
--- a/scripts/tracetool/format/log_stap.py
+++ b/scripts/tracetool/format/log_stap.py
@@ -83,7 +83,7 @@ def c_fmt_to_stap(fmt):
# and "%ll" is not valid at all. Similarly the size_t
# based "%z" size qualifier is not valid. We just
# strip all size qualifiers for sanity.
- fmt = re.sub("%(\d*)(l+|z)(x|u|d)", "%\\1\\3", "".join(bits))
+ fmt = re.sub(r"%(\d*)(l+|z)(x|u|d)", r"%\1\3", "".join(bits))
return fmt
def generate(events, backend, group):
--
2.41.0
- [PULL 07/32] scripts: Mark feature_to_c.py as non-executable to fix a build issue, (continued)
- [PULL 07/32] scripts: Mark feature_to_c.py as non-executable to fix a build issue, Paolo Bonzini, 2023/10/18
- [PULL 08/32] scripts/get_maintainer.pl: don't print parentheses, Paolo Bonzini, 2023/10/18
- [PULL 09/32] tests/docker: avoid invalid escape in Python string, Paolo Bonzini, 2023/10/18
- [PULL 04/32] target/i386/cpu: Fix CPUID_HT exposure, Paolo Bonzini, 2023/10/18
- [PULL 10/32] docs/sphinx: avoid invalid escape in Python string, Paolo Bonzini, 2023/10/18
- [PULL 11/32] target/hexagon: avoid invalid escape in Python string, Paolo Bonzini, 2023/10/18
- [PULL 12/32] tests/avocado: avoid invalid escape in Python string, Paolo Bonzini, 2023/10/18
- [PULL 13/32] tests/vm: avoid invalid escape in Python string, Paolo Bonzini, 2023/10/18
- [PULL 17/32] meson, cutils: allow non-relocatable installs, Paolo Bonzini, 2023/10/18
- [PULL 14/32] tracetool: avoid invalid escape in Python string,
Paolo Bonzini <=
- [PULL 16/32] meson: do not use set10, Paolo Bonzini, 2023/10/18
- [PULL 15/32] meson: do not build shaders by default, Paolo Bonzini, 2023/10/18
- [PULL 19/32] hw/xen: cleanup sourcesets, Paolo Bonzini, 2023/10/18
- [PULL 20/32] hw/remote: move stub vfu_object_set_bus_irq out of stubs/, Paolo Bonzini, 2023/10/18
- [PULL 22/32] configure, tests/tcg: simplify GDB conditionals, Paolo Bonzini, 2023/10/18
- [PULL 21/32] tests/tcg/arm: move non-SVE tests out of conditional, Paolo Bonzini, 2023/10/18
- [PULL 18/32] configure: clean up handling of CFI option, Paolo Bonzini, 2023/10/18
- [PULL 24/32] configure: clean up PIE option handling, Paolo Bonzini, 2023/10/18
- [PULL 27/32] configure: move environment-specific defaults to config-meson.cross, Paolo Bonzini, 2023/10/18
- [PULL 25/32] configure: remove some dead cruft, Paolo Bonzini, 2023/10/18