Permalink
Browse files

Fix regression where E231 was triggered on the last comma if there's …

…a newline before the closing ')', ']' or '}'.
  • Loading branch information...
1 parent e0eb405 commit 01850eb48c9023348745d668f50c939bbee7b04c @florentx florentx committed Mar 4, 2010
Showing with 9 additions and 2 deletions.
  1. +3 −2 pep8.py
  2. +6 −0 testsuite/E231not.py
View
@@ -840,8 +840,9 @@ def build_tokens_line(self):
end_line, end = previous[3]
start_line, start = token[2]
if end_line != start_line: # different row
- if (self.lines[end_line - 1][end - 1] not in '{[('
- and text not in ')}]'):
+ prev_text = self.lines[end_line - 1][end - 1]
+ if prev_text == ',' or (prev_text not in '{[('
+ and text not in '}])'):
logical.append(' ')
length += 1
elif end != start: # different column
View
@@ -1,2 +1,8 @@
a = (4,)
b = (5, )
+
+result = {
+ 'key1': 'value',
+ 'key2': 'value',
+}
+

0 comments on commit 01850eb

Please sign in to comment.