[llvm] bcc83ef - github-automation.py: Use raw strings for regex (#184326)

via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 8 01:53:06 PDT 2026


Author: Kleis Auke Wolthuizen
Date: 2026-04-08T09:53:02+01:00
New Revision: bcc83ef9af57cd9f3b8a252e2db53843394c79aa

URL: https://github.com/llvm/llvm-project/commit/bcc83ef9af57cd9f3b8a252e2db53843394c79aa
DIFF: https://github.com/llvm/llvm-project/commit/bcc83ef9af57cd9f3b8a252e2db53843394c79aa.diff

LOG: github-automation.py: Use raw strings for regex (#184326)

Avoids a `SyntaxWarning: invalid escape sequence`.

As noticed in:

https://github.com/llvm/llvm-project/actions/runs/22620420192/job/65543770329

https://github.com/llvm/llvm-project/actions/runs/22607027706/job/65501262987

Added: 
    

Modified: 
    llvm/utils/git/github-automation.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/git/github-automation.py b/llvm/utils/git/github-automation.py
index 91289bc9b908b..b9b5e92de3c97 100755
--- a/llvm/utils/git/github-automation.py
+++ b/llvm/utils/git/github-automation.py
@@ -54,9 +54,9 @@ def escape_description(str):
     # https://github.com/github/markup/issues/1168#issuecomment-494946168
     str = html.escape(str, False)
     # '@' followed by alphanum is a user name
-    str = re.sub("@(?=\w)", "@<!-- -->", str)
+    str = re.sub(r"@(?=\w)", "@<!-- -->", str)
     # '#' followed by digits is considered an issue number
-    str = re.sub("#(?=\d)", "#<!-- -->", str)
+    str = re.sub(r"#(?=\d)", "#<!-- -->", str)
     return str
 
 
@@ -662,7 +662,7 @@ def issue_remove_cherry_pick_failed_label(self):
     def get_main_commit(self, cherry_pick_sha: str) -> github.Commit.Commit:
         commit = self.repo.get_commit(cherry_pick_sha)
         message = commit.commit.message
-        m = re.search("\(cherry picked from commit ([0-9a-f]+)\)", message)
+        m = re.search(r"\(cherry picked from commit ([0-9a-f]+)\)", message)
         if not m:
             return None
         return self.repo.get_commit(m.group(1))


        


More information about the llvm-commits mailing list