diff options
Diffstat (limited to 'Lib/ast.py')
-rw-r--r-- | Lib/ast.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/ast.py b/Lib/ast.py index 02c3b2867f..017047275b 100644 --- a/Lib/ast.py +++ b/Lib/ast.py @@ -194,7 +194,7 @@ def get_docstring(node, clean=True): be found. If the node provided does not have docstrings a TypeError will be raised. """ - if not isinstance(node, (FunctionDef, ClassDef, Module)): + if not isinstance(node, (AsyncFunctionDef, FunctionDef, ClassDef, Module)): raise TypeError("%r can't have docstrings" % node.__class__.__name__) if node.body and isinstance(node.body[0], Expr) and \ isinstance(node.body[0].value, Str): @@ -293,7 +293,6 @@ class NodeTransformer(NodeVisitor): def generic_visit(self, node): for field, old_value in iter_fields(node): - old_value = getattr(node, field, None) if isinstance(old_value, list): new_values = [] for value in old_value: |