From 3f29bdbbc56885fe1f6db9c9b49a5323d1d30ad6 Mon Sep 17 00:00:00 2001 From: Charlotte Date: Fri, 23 Jun 2023 14:38:15 +1000 Subject: [PATCH] smt2: py3.12+: avoid SyntaxWarning. Python 3.12 emits a SyntaxWarning when encountering invalid escape sequences. They still parse as expected. Marking these raw produces the same result without the warnings. --- backends/smt2/smtio.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/smt2/smtio.py b/backends/smt2/smtio.py index a73745896..8094747bc 100644 --- a/backends/smt2/smtio.py +++ b/backends/smt2/smtio.py @@ -768,7 +768,7 @@ class SmtIo: if self.timeinfo: i = 0 - s = "/-\|" + s = r"/-\|" count = 0 num_bs = 0 @@ -1171,7 +1171,7 @@ class MkVcd: def escape_name(self, name): name = re.sub(r"\[([0-9a-zA-Z_]*[a-zA-Z_][0-9a-zA-Z_]*)\]", r"<\1>", name) - if re.match("[\[\]]", name) and name[0] != "\\": + if re.match(r"[\[\]]", name) and name[0] != "\\": name = "\\" + name return name