MCPcopy Index your code
hub / github.com/RustPython/RustPython / do_jump

Method do_jump

Lib/pdb.py:1070–1096  ·  view source on GitHub ↗

j(ump) lineno Set the next line that will be executed. Only available in the bottom-most frame. This lets you jump back and execute code again, or jump forward to skip code that you don't want to run. It should be noted that not all jumps are allowed -- for

(self, arg)

Source from the content-addressed store, hash-verified

1068 do_c = do_cont = do_continue
1069
1070 def do_jump(self, arg):
1071 """j(ump) lineno
1072 Set the next line that will be executed. Only available in
1073 the bottom-most frame. This lets you jump back and execute
1074 code again, or jump forward to skip code that you don't want
1075 to run.
1076
1077 It should be noted that not all jumps are allowed -- for
1078 instance it is not possible to jump into the middle of a
1079 for loop or out of a finally clause.
1080 """
1081 if self.curindex + 1 != len(self.stack):
1082 self.error('You can only jump within the bottom frame')
1083 return
1084 try:
1085 arg = int(arg)
1086 except ValueError:
1087 self.error("The 'jump' command requires a line number")
1088 else:
1089 try:
1090 # Do the jump, fix up our copy of the stack, and display the
1091 # new position
1092 self.curframe.f_lineno = arg
1093 self.stack[self.curindex] = self.stack[self.curindex][0], arg
1094 self.print_stack_entry(self.stack[self.curindex])
1095 except ValueError as e:
1096 self.error('Jump failed: %s' % e)
1097 do_j = do_jump
1098
1099 def do_debug(self, arg):

Callers

nothing calls this directly

Calls 3

errorMethod · 0.95
print_stack_entryMethod · 0.95
lenFunction · 0.85

Tested by

no test coverage detected