File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -463,9 +463,16 @@ def run_main(comline_list):
463
463
pyf_files , _ = filter_files ("" , "[.]pyf([.]src|)" , comline_list )
464
464
# Checks that no existing modulename is defined in a pyf file
465
465
# 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 :
467
468
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
469
476
# gh-22819 -- end
470
477
files , options = scaninputline (comline_list )
471
478
auxfuncs .options = options
You can’t perform that action at this time.
0 commit comments