diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2021-01-19 14:32:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-19 14:32:51 -0700 |
commit | efaf210f7128f32e6d3d193f79ccc6b43ff8c006 (patch) | |
tree | e16f04c0d09a784f43ae944302cbbeb55dd35c93 /numpy/f2py/func2subr.py | |
parent | 09416c2934a5f592970e1d97c0298924eed009f6 (diff) | |
parent | c4014c7fb4f1753f296bac842098decf061e39bb (diff) | |
download | numpy-efaf210f7128f32e6d3d193f79ccc6b43ff8c006.tar.gz |
Merge pull request #18184 from pearu/17797
BUG: Fix f2py bugs when wrapping F90 subroutines.
Diffstat (limited to 'numpy/f2py/func2subr.py')
-rw-r--r-- | numpy/f2py/func2subr.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/numpy/f2py/func2subr.py b/numpy/f2py/func2subr.py index e9976f43c..21d4c009c 100644 --- a/numpy/f2py/func2subr.py +++ b/numpy/f2py/func2subr.py @@ -130,7 +130,7 @@ def createfuncwrapper(rout, signature=0): l = l + ', ' + fortranname if need_interface: for line in rout['saved_interface'].split('\n'): - if line.lstrip().startswith('use '): + if line.lstrip().startswith('use ') and '__user__' not in line: add(line) args = args[1:] @@ -222,7 +222,7 @@ def createsubrwrapper(rout, signature=0): if need_interface: for line in rout['saved_interface'].split('\n'): - if line.lstrip().startswith('use '): + if line.lstrip().startswith('use ') and '__user__' not in line: add(line) dumped_args = [] @@ -247,7 +247,10 @@ def createsubrwrapper(rout, signature=0): pass else: add('interface') - add(rout['saved_interface'].lstrip()) + for line in rout['saved_interface'].split('\n'): + if line.lstrip().startswith('use ') and '__user__' in line: + continue + add(line) add('end interface') sargs = ', '.join([a for a in args if a not in extra_args]) |