From 2ac450e5c0c0ca47040c2fd4147f45f42010510c Mon Sep 17 00:00:00 2001 From: Rohit Goswami Date: Mon, 17 Apr 2023 00:41:10 +0000 Subject: BUG: Ensure function wrappers have consistent args --- numpy/f2py/func2subr.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'numpy/f2py/func2subr.py') diff --git a/numpy/f2py/func2subr.py b/numpy/f2py/func2subr.py index 2a05f065b..cc3cdc5b4 100644 --- a/numpy/f2py/func2subr.py +++ b/numpy/f2py/func2subr.py @@ -119,6 +119,12 @@ def createfuncwrapper(rout, signature=0): sargs = ', '.join(args) if f90mode: + # gh-23598 fix warning + # Essentially, this gets called again with modules where the name of the + # function is added to the arguments, which is not required, and removed + sargs = sargs.replace(f"{name}, ", '') + args = [arg for arg in args if arg != name] + rout['args'] = args add('subroutine f2pywrap_%s_%s (%s)' % (rout['modulename'], name, sargs)) if not signature: -- cgit v1.2.1