summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPearu Peterson <pearu.peterson@gmail.com>2021-01-18 15:22:54 +0200
committerPearu Peterson <pearu.peterson@gmail.com>2021-01-18 15:22:54 +0200
commita2f6fbb5b068a4e589bd95b8774d3624062c0995 (patch)
tree200b6e52fb360ef944c5e8553af828074beedef5
parent26a2f584dc79cb0ef02ca41f4785152b8041c71b (diff)
downloadnumpy-a2f6fbb5b068a4e589bd95b8774d3624062c0995.tar.gz
BUG: subroutines using assumed shape arrays must be treated as F90 codes. Don't split inline comments.
-rwxr-xr-xnumpy/f2py/rules.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/numpy/f2py/rules.py b/numpy/f2py/rules.py
index f1490527e..12ed1f1ca 100755
--- a/numpy/f2py/rules.py
+++ b/numpy/f2py/rules.py
@@ -1186,7 +1186,7 @@ def buildmodule(m, um):
for nb in nb_list:
api, wrap = buildapi(nb)
if wrap:
- if ismoduleroutine(nb):
+ if ismoduleroutine(nb) or issubroutine_wrap(nb):
funcwrappers2.append(wrap)
else:
funcwrappers.append(wrap)
@@ -1310,7 +1310,11 @@ def buildmodule(m, um):
'! It contains Fortran 90 wrappers to fortran functions.\n')
lines = []
for l in ('\n\n'.join(funcwrappers2) + '\n').split('\n'):
- if len(l) > 72 and l[0] == ' ':
+ i = l.find('!')
+ if i >= 0 and i < 72:
+ # don't split comment lines
+ lines.append(l + '\n')
+ elif len(l) > 72 and l[0] == ' ':
lines.append(l[:72] + '&\n &')
l = l[72:]
while len(l) > 66: