Skip to content

Commit 3cdfd82

Browse files
committed
BUG: Cleanup and use directives correctly
1 parent f21d18a commit 3cdfd82

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

numpy/f2py/crackfortran.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ def readfortrancode(ffile, dowithline=show, istop=1):
455455
is_f2py_directive = True
456456
else: # Skip comment line
457457
cont = False
458+
is_f2py_directive = False
458459
continue
459460
elif strictf77:
460461
if len(l) > 72:
@@ -480,7 +481,8 @@ def readfortrancode(ffile, dowithline=show, istop=1):
480481
else:
481482
# clean up line beginning from possible digits.
482483
l = ' ' + l[5:]
483-
if localdolowercase and not is_f2py_directive:
484+
# f2py directives are already by this point
485+
if localdolowercase:
484486
finalline = ll.lower()
485487
else:
486488
finalline = ll
@@ -541,7 +543,8 @@ def readfortrancode(ffile, dowithline=show, istop=1):
541543
else:
542544
dowithline(finalline)
543545
l1 = ll
544-
if localdolowercase and not is_f2py_directive:
546+
# Last line should never have an f2py directive anyway
547+
if localdolowercase:
545548
finalline = ll.lower()
546549
else:
547550
finalline = ll

0 commit comments

Comments
 (0)