From a9b61149eb766d9a21aea100b2d74ec7d5ac1560 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 27 May 2019 01:08:42 +0200 Subject: [PATCH] Fix get_decorators for async functions --- parso/python/tree.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/parso/python/tree.py b/parso/python/tree.py index 4955ee7..d0206d7 100644 --- a/parso/python/tree.py +++ b/parso/python/tree.py @@ -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