[clang] [clang-tools-extra] [compiler-rt] [libcxx] [lld] [lldb] [llvm] [mlir] Fix SyntaxWarning messages from python 3.12 (PR #86806)

via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 27 10:18:09 PDT 2024


================

----------------
AngryLoki wrote:

But automatic replacement is not possible, because `"\n" != r"\n"`. But I checked carefully that all changed places with `\n` and `\t` are regexps, and in regexps it is semantically the same.
```
>>> '\n' in 'test \n test'
True
>>> r'\n' in 'test \n test'
False
>>> import re
>>> re.search('\n', 'test \n test')
<re.Match object; span=(5, 6), match='\n'>
>>> re.search(r'\n', 'test \n test')
<re.Match object; span=(5, 6), match='\n'>
```

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


More information about the cfe-commits mailing list