Fix PyDoc: Invalid signature for functions without arguments

Ref: !130031
This commit is contained in:
Campbell Barton
2024-11-09 13:17:43 +11:00
parent cd07e729a2
commit 56cea4a36b

View File

@@ -1893,7 +1893,7 @@ def pyrna2sphinx(basepath):
for op in ops_mod:
args_str = ", ".join(prop.get_arg_default(force=True) for prop in op.args)
# All operator arguments are keyword only (denoted by the leading `*`).
fw(".. function:: {:s}(*, {:s})\n\n".format(op.func_name, args_str))
fw(".. function:: {:s}({:s}{:s})\n\n".format(op.func_name, "*, " if args_str else "", args_str))
# If the description isn't valid, we output the standard warning
# with a link to the wiki so that people can help.