8000 BUG: Handle modules correctly for F77 · numpy/numpy@939aeea · GitHub
[go: up one dir, main page]

Skip to content

Commit 939aeea

Browse files
committed
BUG: Handle modules correctly for F77
Closes gh-25263
1 parent e8c5d7b commit 939aeea

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

numpy/f2py/f2py2e.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,17 @@ def run_main(comline_list):
455455
pyf_files, _ = filter_files("", "[.]pyf([.]src|)", comline_list)
456456
# Checks that no existing modulename is defined in a pyf file
457457
# TODO: Remove all this when scaninputline is replaced
458-
if "-h" not in comline_list and args.module_name: # Can't check what doesn't exist yet, -h creates the pyf
459-
modname = validate_modulename(pyf_files, args.module_name)
460-
comline_list += ['-m', modname] # needed for the rest of scaninputline
458+
modname = "untitled" # Default value
459+
if args.module_name:
460+
if "-h" in comline_list:
461+
modname = (
462+
args.module_name
463+
) # Directly use the module name from args when -h is present
464+
else:
465+
modname = validate_modulename(
466+
pyf_files, args.module_name
467+
) # Validate modname when -h is not present
468+
comline_list += ['-m', modname] # needed for the rest of scaninputline
461469
# gh-22819 -- end
462470
files, options = scaninputline(comline_list)
463471
auxfuncs.options = options

0 commit comments

Comments
 (0)
0