summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xpycodestyle.py1
-rw-r--r--testsuite/E30not.py4
2 files changed, 5 insertions, 0 deletions
diff --git a/pycodestyle.py b/pycodestyle.py
index b9a37f0..235532c 100755
--- a/pycodestyle.py
+++ b/pycodestyle.py
@@ -1797,6 +1797,7 @@ def expand_indent(line):
>>> expand_indent(' \t')
16
"""
+ line = line.rstrip('\n\r')
if '\t' not in line:
return len(line) - len(line.lstrip())
result = 0
diff --git a/testsuite/E30not.py b/testsuite/E30not.py
index ef795a8..ba0f742 100644
--- a/testsuite/E30not.py
+++ b/testsuite/E30not.py
@@ -167,6 +167,10 @@ def foo(x):
# for no E30x being emitted.
def bar(): pass
def baz(): pass
+
+
+def main():
+ pass
#: E704:4:5 E704:5:5
def foo():
# This emits the (ignored-by-default) E704, but here we're testing