Skip to content

Commit

Permalink
Merge pull request #528 from kcaylor/master
Browse files Browse the repository at this point in the history
  • Loading branch information
jph00 authored Apr 26, 2024
2 parents c5e6754 + a610e81 commit e056b8d
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 37 deletions.
4 changes: 2 additions & 2 deletions fastcore/docments.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import re
from tokenize import tokenize,COMMENT
from ast import parse,FunctionDef,AnnAssign
from ast import parse,FunctionDef,AsyncFunctionDef,AnnAssign
from io import BytesIO
from textwrap import dedent
from types import SimpleNamespace
Expand Down Expand Up @@ -69,7 +69,7 @@ def _param_locs(s, returns=True):
body = _parses(s).body
if len(body)==1: #or not isinstance(body[0], FunctionDef): return None
defn = body[0]
if isinstance(defn, FunctionDef):
if isinstance(defn, (FunctionDef, AsyncFunctionDef)):
res = {arg.lineno:arg.arg for arg in defn.args.args}
if returns and defn.returns: res[defn.returns.lineno] = 'return'
return res
Expand Down
Loading

0 comments on commit e056b8d

Please sign in to comment.