File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff 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+ if "-h" in comline_list :
459+ if args .module_name :
460+ modname = args .module_name # Directly use the module name from args
461+ else :
462+ modname = 'untitled'
463+ else :
464+ if args .module_name :
465+ modname = validate_modulename (pyf_files , args .module_name )
466+ else :
467+ modname = 'untitled'
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
You can’t perform that action at this time.
0 commit comments