diff options
author | Pearu Peterson <pearu.peterson@gmail.com> | 2021-01-19 13:16:25 +0200 |
---|---|---|
committer | Pearu Peterson <pearu.peterson@gmail.com> | 2021-01-19 13:16:25 +0200 |
commit | 5db1d5fb64ff35429205aec4b6927a4b2c6b552b (patch) | |
tree | bae677e98595e0363f0a3d56e2525dac0e6a405d | |
parent | 065f50706192d62fc00ff39660ea051539845f12 (diff) | |
download | numpy-5db1d5fb64ff35429205aec4b6927a4b2c6b552b.tar.gz |
Apply reviewer comments.
-rwxr-xr-x | numpy/f2py/rules.py | 6 | ||||
-rw-r--r-- | numpy/f2py/tests/test_callback.py | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/numpy/f2py/rules.py b/numpy/f2py/rules.py index 05fba9c4f..4e1cf0c7d 100755 --- a/numpy/f2py/rules.py +++ b/numpy/f2py/rules.py @@ -1291,8 +1291,7 @@ def buildmodule(m, um): 'C It contains Fortran 77 wrappers to fortran functions.\n') lines = [] for l in ('\n\n'.join(funcwrappers) + '\n').split('\n'): - i = l.find('!') - if i >= 0 and i < 66: + if 0 <= l.find('!') < 66: # don't split comment lines lines.append(l + '\n') elif l and l[0] == ' ': @@ -1317,8 +1316,7 @@ def buildmodule(m, um): '! It contains Fortran 90 wrappers to fortran functions.\n') lines = [] for l in ('\n\n'.join(funcwrappers2) + '\n').split('\n'): - i = l.find('!') - if i >= 0 and i < 72: + if 0 <= l.find('!') < 72: # don't split comment lines lines.append(l + '\n') elif len(l) > 72 and l[0] == ' ': diff --git a/numpy/f2py/tests/test_callback.py b/numpy/f2py/tests/test_callback.py index 6a59b6398..f847dd49f 100644 --- a/numpy/f2py/tests/test_callback.py +++ b/numpy/f2py/tests/test_callback.py @@ -217,7 +217,7 @@ class TestF90Callback(util.F2PyTest): suffix = '.f90' - code = """ + code = textwrap.dedent(""" function gh17797(f, y) result(r) external f integer(8) :: r, f @@ -225,7 +225,7 @@ class TestF90Callback(util.F2PyTest): r = f(0) r = r + sum(y) end function gh17797 - """ + """) def test_gh17797(self): |