diff --git a/docs/release_notes.rst b/docs/release_notes.rst index 7067accb..c6ed79ab 100644 --- a/docs/release_notes.rst +++ b/docs/release_notes.rst @@ -24,6 +24,8 @@ Bug Fixes * Fixed a false-positive recognition of section names causing D405 to be reported (#311, #317). +* Fixed a bug where functions that don't end with a newline will sometimes raise + an exception (#321, #336). 2.1.1 - October 9th, 2017 diff --git a/src/pydocstyle/parser.py b/src/pydocstyle/parser.py index 8a172d88..a612402f 100644 --- a/src/pydocstyle/parser.py +++ b/src/pydocstyle/parser.py @@ -564,9 +564,8 @@ def parse_definition(self, class_): skipped_error_codes) for child in definition.children: child.parent = definition - self.log.debug("finished parsing %s '%s'. Next token is %r (%s)", - class_.__name__, name, self.current.kind, - self.current.value) + self.log.debug("finished parsing %s '%s'. Next token is %r", + class_.__name__, name, self.current) return definition def parse_skip_comment(self):