summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpycodestyle.py5
-rw-r--r--testsuite/W60.py4
2 files changed, 8 insertions, 1 deletions
diff --git a/pycodestyle.py b/pycodestyle.py
index 766e6bd..a022165 100755
--- a/pycodestyle.py
+++ b/pycodestyle.py
@@ -1509,12 +1509,15 @@ def python_3000_backticks(logical_line):
@register_check
-def python_3000_invalid_escape_sequence(logical_line, tokens):
+def python_3000_invalid_escape_sequence(logical_line, tokens, noqa):
r"""Invalid escape sequences are deprecated in Python 3.6.
Okay: regex = r'\.png$'
W605: regex = '\.png$'
"""
+ if noqa:
+ return
+
# https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
valid = [
'\n',
diff --git a/testsuite/W60.py b/testsuite/W60.py
index 42a8c6d..5003677 100644
--- a/testsuite/W60.py
+++ b/testsuite/W60.py
@@ -40,6 +40,10 @@ regex = r'''
\\.png$
'''
s = '\\'
+regex = '\w' # noqa
+regex = '''
+\w
+''' # noqa
#: W606
async = 42
#: W606