mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix property access of vararg and kwarg.
This commit is contained in:
parent
78aac416a4
commit
0ee64fa40c
@ -55,7 +55,7 @@ def signature_from_ast(node: ast.FunctionDef, bound_method: bool,
|
||||
|
||||
if node.args.vararg:
|
||||
param = Parameter(node.args.vararg.arg, Parameter.VAR_POSITIONAL,
|
||||
annotation=arg.type_comment or Parameter.empty)
|
||||
annotation=node.args.vararg.type_comment or Parameter.empty)
|
||||
params.append(param)
|
||||
|
||||
for arg in node.args.kwonlyargs:
|
||||
@ -65,7 +65,7 @@ def signature_from_ast(node: ast.FunctionDef, bound_method: bool,
|
||||
|
||||
if node.args.kwarg:
|
||||
param = Parameter(node.args.kwarg.arg, Parameter.VAR_KEYWORD,
|
||||
annotation=arg.type_comment or Parameter.empty)
|
||||
annotation=node.args.kwarg.type_comment or Parameter.empty)
|
||||
params.append(param)
|
||||
|
||||
# Remove first parameter when *obj* is bound_method
|
||||
|
Loading…
Reference in New Issue
Block a user