8000 BUG: Handle .pyf.src again · charris/numpy@b6df150 · GitHub
[go: up one dir, main page]

Skip to content

Commit b6df150

Browse files
HaoZekecharris
authored andcommitted
BUG: Handle .pyf.src again
Closes numpygh-25286
1 parent 9eca8ce commit b6df150

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

numpy/f2py/f2py2e.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,16 @@ def run_main(comline_list):
463463
pyf_files, _ = filter_files("", "[.]pyf([.]src|)", comline_list)
464464
# Checks that no existing modulename is defined in a pyf file
465465
# TODO: Remove all this when scaninputline is replaced
466-
if "-h" not in comline_list and args.module_name: # Can't check what doesn't exist yet, -h creates the pyf
466+
modname = None
467+
if "-h" not in comline_list:
467468
modname = validate_modulename(pyf_files, args.module_name)
468-
comline_list += ['-m', modname] # needed for the rest of scaninputline
469+
# If -h is present or no valid modname found, use the module name from args
470+
if modname is None and args.module_name:
471+
modname = args.module_name
472+
# If no module name is specified in args or found in pyf_files, use default
473+
if modname is None:
474+
modname = "untitled"
475+
comline_list += ["-m", modname] # needed for the rest of scaninputline
469476
# gh-22819 -- end
470477
files, options = scaninputline(comline_list)
471478
auxfuncs.options = options

0 commit comments

Comments
 (0)
0