[all-commits] [llvm/llvm-project] 7ed0f5: [lit] Use raw strings for backslash escapes to fix...

Michał Górny via All-commits all-commits at lists.llvm.org
Sun Aug 20 18:51:37 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7ed0f5b6de74989c739389770a2d45dc7d58166a
      https://github.com/llvm/llvm-project/commit/7ed0f5b6de74989c739389770a2d45dc7d58166a
  Author: Michał Górny <mgorny at gentoo.org>
  Date:   2023-08-21 (Mon, 21 Aug 2023)

  Changed paths:
    M llvm/utils/lit/lit/TestRunner.py

  Log Message:
  -----------
  [lit] Use raw strings for backslash escapes to fix SyntaxWarnings

Use raw strings instead of regular strings when escapes are used for
regex matches or arbitrary letters rather than C-style characters.
This fixes `SyntaxWarning`s:

```
TestRunner.py:205: SyntaxWarning: invalid escape sequence '\c'
  """
TestRunner.py:1566: SyntaxWarning: invalid escape sequence '\s'
  match = _caching_re_compile("^\s*%else\s*(%{)?").search(ln)
```

Differential Revision: https://reviews.llvm.org/D158356




More information about the All-commits mailing list