[clang] [clang] SyntaxWarning: invalid escape sequence '\s' with Python3.12 (PR #78036)

via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 13 07:03:26 PST 2024


================
@@ -6,6 +6,6 @@
 output_file = open(sys.argv[2], "w")
 
 for line in input_file:
-    m = re.search("^\s+(clang_[^;]+)", line)
+    m = re.search("^\\s+(clang_[^;]+)", line)
----------------
cor3ntin wrote:

```suggestion
    m = re.search(r"^\s+(clang_[^;]+)", line)
```

Making it a raw string is a marginally cleaner fix

https://github.com/llvm/llvm-project/pull/78036


More information about the cfe-commits mailing list