mirror of
https://github.com/davidhalter/parso.git
synced 2026-08-13 19:41:03 +08:00
Fix get_decorators for async functions
This commit is contained in:
@@ -466,6 +466,9 @@ class ClassOrFunc(Scope):
|
|||||||
:rtype: list of :class:`Decorator`
|
:rtype: list of :class:`Decorator`
|
||||||
"""
|
"""
|
||||||
decorated = self.parent
|
decorated = self.parent
|
||||||
|
if decorated.type == 'async_funcdef':
|
||||||
|
decorated = decorated.parent
|
||||||
|
|
||||||
if decorated.type == 'decorated':
|
if decorated.type == 'decorated':
|
||||||
if decorated.children[0].type == 'decorators':
|
if decorated.children[0].type == 'decorators':
|
||||||
return decorated.children[0].children
|
return decorated.children[0].children
|
||||||
|
|||||||
Reference in New Issue
Block a user