Skip to content

Commit 32cfd6d

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

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

numpy/f2py/f2py2e.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,14 @@ 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+
if "-h" in comline_list:
459+
modname = args.module_name # Directly use the module name from args
460+
else:
461+
if args.module_name:
462+
modname = validate_modulename(pyf_files, args.module_name)
463+
else:
464+
modname = 'untitled'
465+
comline_list += ['-m', modname] # needed for the rest of scaninputline
461466
# gh-22819 -- end
462467
files, options = scaninputline(comline_list)
463468
auxfuncs.options = options

0 commit comments

Comments
 (0)