Fix "invalid escape sequence" when running with -Werror

```
$ python3.7 -Werror
Python 3.7.0rc1 (default, Jun 16 2018, 03:32:08) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> '# noqa(?:: (?P<codes>([A-Z][0-9]+(?:[,\s]+)?)+))?'
  File "<stdin>", line 1
SyntaxError: invalid escape sequence \s
```
This commit is contained in:
Anthony Sottile 2018-06-18 06:25:07 +00:00
parent 33e7eae53a
commit 6a725a0a52

View file

@ -46,7 +46,7 @@ NOQA_INLINE_REGEXP = re.compile(
# We do not care about the ``: `` that follows ``noqa``
# We do not care about the casing of ``noqa``
# We want a comma-separated list of errors
'# noqa(?:: (?P<codes>([A-Z][0-9]+(?:[,\s]+)?)+))?',
r'# noqa(?:: (?P<codes>([A-Z][0-9]+(?:[,\s]+)?)+))?',
re.IGNORECASE
)