File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -3635,9 +3635,14 @@ def parse_args():
36353635 opts .module = opt_module .module
36363636 args = args [2 :]
36373637 elif args [0 ].startswith ('-' ):
3638- # Invalid argument before the script name.
3639- invalid_args = list (itertools .takewhile (lambda a : a .startswith ('-' ), args ))
3640- parser .error (f"unrecognized arguments: { ' ' .join (invalid_args )} " )
3638+ if args [0 ] == '--' :
3639+ args .pop (0 )
3640+ if not args :
3641+ parser .error ("missing script or module to run" )
3642+ else :
3643+ # Invalid argument before the script name.
3644+ invalid_args = list (itertools .takewhile (lambda a : a .startswith ('-' ), args ))
3645+ parser .error (f"unrecognized arguments: { ' ' .join (invalid_args )} " )
36413646
36423647 # Otherwise it's debugging a script and we already parsed all -c commands.
36433648
You can’t perform that action at this time.
0 commit comments