Skip to content

Commit

Permalink
Fix "invalid escape sequence" when running with -Werror
Browse files Browse the repository at this point in the history
```
$ 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
```
  • Loading branch information
asottile committed Jun 18, 2018
1 parent 33e7eae commit 6a725a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/flake8/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
# 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
)

Expand Down

0 comments on commit 6a725a0

Please sign in to comment.