summaryrefslogtreecommitdiff
path: root/pep8.py
diff options
context:
space:
mode:
Diffstat (limited to 'pep8.py')
-rwxr-xr-xpep8.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pep8.py b/pep8.py
index 8548b9a..5b6300b 100755
--- a/pep8.py
+++ b/pep8.py
@@ -459,7 +459,8 @@ def continued_indentation(logical_line, tokens, indent_level, hang_closing,
open_row = 0
hang = rel_indent[row] - rel_indent[open_row]
close_bracket = (token_type == tokenize.OP and text in ']})')
- visual_indent = not close_bracket and indent_chances.get(start[1])
+ visual_indent = (not close_bracket and hang > 0 and
+ indent_chances.get(start[1]))
if close_bracket and indent[depth]:
# closing bracket for visual indent
@@ -474,7 +475,7 @@ def continued_indentation(logical_line, tokens, indent_level, hang_closing,
# visual indent is verified
if not indent[depth]:
indent[depth] = start[1]
- elif hang > 0 and visual_indent in (text, str):
+ elif visual_indent in (text, str):
# ignore token lined up with matching one from a previous line
pass
elif indent[depth] and start[1] < indent[depth]: