mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #24688: ast.get_docstring() for 'async def' functions.
This commit is contained in:
parent
943ddac142
commit
2f07a66ded
3 changed files with 6 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue