https://github.com/DamonFool created
https://github.com/llvm/llvm-project/pull/78036
The following SyntaxWarning was observed with Python3.12 .
```
llvm-project/clang/tools/libclang/linker-script-to-export-list.py:9:
SyntaxWarning: invalid escape sequence '\s'
m = re.search("^\s+(clang_[^;]+)", line)
```
Similar problem had been reported here
https://stackoverflow.com/questions/57645829/why-am-i-getting-a-syntaxwarning-invalid-escape-sequence-s-warning
.
It would be better to fix it.
Thanks.
>From 57fa67bf86bea09b9c6011b8c9ec6f69fe11852f Mon Sep 17 00:00:00 2001
From: Jie Fu <[email protected]>
Date: Sat, 13 Jan 2024 21:51:36 +0800
Subject: [PATCH] [clang] SyntaxWarning: invalid escape sequence '\s' with
Python3.12
llvm-project/clang/tools/libclang/linker-script-to-export-list.py:9:
SyntaxWarning: invalid escape sequence '\s'
m = re.search("^\s+(clang_[^;]+)", line)
---
clang/tools/libclang/linker-script-to-export-list.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang/tools/libclang/linker-script-to-export-list.py
b/clang/tools/libclang/linker-script-to-export-list.py
index 745996028d835f..35bfa230be704a 100644
--- a/clang/tools/libclang/linker-script-to-export-list.py
+++ b/clang/tools/libclang/linker-script-to-export-list.py
@@ -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)
if m:
output_file.write(m.group(1) + "\n")
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits