File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -3176,7 +3176,11 @@ def main():
31763176 if opts .pid :
31773177 # If attaching to a remote pid, unrecognized arguments are not allowed.
31783178 # This will raise an error if there are extra unrecognized arguments.
3179- parser .parse_args ()
3179+ opts = parser .parse_args ()
3180+ if opts .module :
3181+ parser .error ("argument -m: not allowed with argument --pid" )
3182+ attach (opts .pid , opts .commands )
3183+ return
31803184 elif opts .module :
31813185 # If a module is being debugged, we consider the arguments after "-m module" to
31823186 # be potential arguments to the module itself. We need to parse the arguments
@@ -3196,12 +3200,6 @@ def main():
31963200 parser .error (f"unrecognized arguments: { ' ' .join (invalid_args )} " )
31973201 sys .exit (2 )
31983202
3199- if opts .pid :
3200- if opts .module :
3201- parser .error ("argument -m: not allowed with argument --pid" )
3202- attach (opts .pid , opts .commands )
3203- return
3204-
32053203 if opts .module :
32063204 file = opts .module
32073205 target = _ModuleTarget (file )
You can’t perform that action at this time.
0 commit comments