More small fixes regarding docstrings.

This commit is contained in:
Dave Halter
2017-07-21 19:56:04 +02:00
parent 97b98a1da3
commit 9e5d6db24a
3 changed files with 11 additions and 3 deletions

View File

@@ -230,7 +230,13 @@ class PEP8Normalizer(ErrorFinder):
if child.type == 'simple_stmt':
# Remove the newline.
children = child.children[:-1]
found_docstring = False
for c in children:
if c.type == 'string' and not found_docstring:
continue
found_docstring = True
if c.type == 'expr_stmt' and \
all(_is_magic_name(n) for n in c.get_defined_names()):
continue