summaryrefslogtreecommitdiffstats
path: root/Lib/ast.py
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-07-23 05:54:35 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-07-23 05:54:35 (GMT)
commit2f07a66dedb6f69cbe601f7ca2c3fca66898ffe3 (patch)
tree6c8fc0a96b616e02eab21f54afc4ba3dc6741235 /Lib/ast.py
parent943ddac14227bf9cdd224903bc5f5696997a0129 (diff)
downloadcpython-2f07a66dedb6f69cbe601f7ca2c3fca66898ffe3.zip
cpython-2f07a66dedb6f69cbe601f7ca2c3fca66898ffe3.tar.gz
cpython-2f07a66dedb6f69cbe601f7ca2c3fca66898ffe3.tar.bz2
Issue #24688: ast.get_docstring() for 'async def' functions.
Diffstat (limited to 'Lib/ast.py')
-rw-r--r--Lib/ast.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/ast.py b/Lib/ast.py
index 02c3b28..03c30f6 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):