[lld] fix(lld/**.python): fix invalid escape sequences (PR #94033)

Eisuke Kawashima via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 23 05:23:10 PDT 2024


https://github.com/e-kwsm updated https://github.com/llvm/llvm-project/pull/94033

>From 92ccc6a25acf397d36309e7dd9d1928085c8e307 Mon Sep 17 00:00:00 2001
From: Eisuke Kawashima <e-kwsm at users.noreply.github.com>
Date: Sat, 11 May 2024 02:39:21 +0900
Subject: [PATCH] fix(lld/**.python): fix invalid escape sequences

---
 lld/test/MachO/tools/validate-unwind-info.py | 2 +-
 lld/utils/benchmark.py                       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lld/test/MachO/tools/validate-unwind-info.py b/lld/test/MachO/tools/validate-unwind-info.py
index ac49f1ecb5889..1cc82f8279273 100755
--- a/lld/test/MachO/tools/validate-unwind-info.py
+++ b/lld/test/MachO/tools/validate-unwind-info.py
@@ -11,7 +11,7 @@
 
 
 def main():
-    hex = "[a-f\d]"
+    hex = r"[a-f\d]"
     hex8 = hex + "{8}"
 
     parser = argparse.ArgumentParser(description=__doc__)
diff --git a/lld/utils/benchmark.py b/lld/utils/benchmark.py
index a07d5ecc69417..7202e07ec438d 100755
--- a/lld/utils/benchmark.py
+++ b/lld/utils/benchmark.py
@@ -51,7 +51,7 @@ def __str__(self):
 def getBenchmarks():
     ret = []
     for i in glob.glob("*/response*.txt"):
-        m = re.match("response-(.*)\.txt", os.path.basename(i))
+        m = re.match(r"response-(.*)\.txt", os.path.basename(i))
         variant = m.groups()[0] if m else None
         ret.append(Bench(os.path.dirname(i), variant))
     return ret



More information about the llvm-commits mailing list