diff options
-rwxr-xr-x | pycodestyle.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pycodestyle.py b/pycodestyle.py index 5b66302..f0ae6dc 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -1535,7 +1535,7 @@ def python_3000_invalid_escape_sequence(logical_line, tokens): while pos >= 0: pos += 1 if string[pos] not in valid: - line = start_line + string[:pos].count('\n') + line = start_line + string.count('\n', 0, pos) if line == start_line: col = start_col + len(prefix) + len(quote) + pos else: |