[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/32] tests/vm: avoid invalid escape in Python string
From: |
Paolo Bonzini |
Subject: |
[PULL 13/32] tests/vm: avoid invalid escape in Python string |
Date: |
Wed, 18 Oct 2023 10:27:33 +0200 |
This is an error in Python 3.12; fix it by using a raw string literal
or by double-escaping the backslash.
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/vm/basevm.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 8aef4cff967..61725b83254 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -331,8 +331,8 @@ def console_init(self, timeout = None):
def console_log(self, text):
for line in re.split("[\r\n]", text):
# filter out terminal escape sequences
- line = re.sub("\x1b\[[0-9;?]*[a-zA-Z]", "", line)
- line = re.sub("\x1b\([0-9;?]*[a-zA-Z]", "", line)
+ line = re.sub("\x1b\\[[0-9;?]*[a-zA-Z]", "", line)
+ line = re.sub("\x1b\\([0-9;?]*[a-zA-Z]", "", line)
# replace unprintable chars
line = re.sub("\x1b", "<esc>", line)
line = re.sub("[\x00-\x1f]", ".", line)
@@ -530,7 +530,7 @@ def get_qemu_version(qemu_path):
and return the major number."""
output = subprocess.check_output([qemu_path, '--version'])
version_line = output.decode("utf-8")
- version_num = re.split(' |\(', version_line)[3].split('.')[0]
+ version_num = re.split(r' |\(', version_line)[3].split('.')[0]
return int(version_num)
def parse_config(config, args):
--
2.41.0
- [PULL 05/32] target/i386: check intercept for XSETBV, (continued)
- [PULL 05/32] target/i386: check intercept for XSETBV, Paolo Bonzini, 2023/10/18
- [PULL 06/32] tests/vm: netbsd: install dtc, Paolo Bonzini, 2023/10/18
- [PULL 02/32] iotests: use the correct python to run linters, Paolo Bonzini, 2023/10/18
- [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 <=
- [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, 2023/10/18
- [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