mirror of
https://github.com/davidhalter/parso.git
synced 2026-01-02 17:43:43 +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`
|
||||
"""
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user