Fix #5019: autodoc: crashed by Form Feed Character

This commit is contained in:
Takeshi KOMIYA
2018-06-10 12:50:52 +09:00
parent ac9f973c9b
commit 0edcae1ff8
3 changed files with 16 additions and 1 deletions

View File

@@ -315,3 +315,12 @@ def test_decorators():
'func3': ('def', 7, 9),
'Foo': ('class', 11, 15),
'Foo.method': ('def', 13, 15)}
def test_formfeed_char():
source = ('class Foo:\n'
'\f\n'
' attr = 1234 #: comment\n')
parser = Parser(source)
parser.parse()
assert parser.comments == {('Foo', 'attr'): 'comment'}