Fix get_decorators for async functions

This commit is contained in:
Dave Halter
2019-05-27 01:08:42 +02:00
parent de416b082e
commit a9b61149eb

View File

@@ -466,6 +466,9 @@ class ClassOrFunc(Scope):
:rtype: list of :class:`Decorator`
"""
decorated = self.parent
if decorated.type == 'async_funcdef':
decorated = decorated.parent
if decorated.type == 'decorated':
if decorated.children[0].type == 'decorators':
return decorated.children[0].children