Commit 9184238
committed
Correctly allow *two* blank lines after a block of one-liners.
Previously
```
def oneliner(): pass
def otheroneliner(): pass
def really_long_func():
with_some_contents
```
would raise an "E302: expected 2 blank lines, found zero" at the last
line of the one liner. Ultimately, this is due to `expand_indent` being
passed a line whose contents are just a newline and nothing else, and
`expand_indent` thinking that the line is indented by 1 character (the
newline), which is wrong.
Fix that by just stripping the newline, and modify a test to cover this
case.1 parent 68cc24f commit 9184238
2 files changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1794 | 1794 | | |
1795 | 1795 | | |
1796 | 1796 | | |
| 1797 | + | |
1797 | 1798 | | |
1798 | 1799 | | |
1799 | 1800 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
170 | 174 | | |
171 | 175 | | |
172 | 176 | | |
| |||
0 commit comments