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 -- fo
(self, arg)
| 1967 | do_c = do_cont = do_continue |
| 1968 | |
| 1969 | def do_jump(self, arg): |
| 1970 | """j(ump) lineno |
| 1971 | |
| 1972 | Set the next line that will be executed. Only available in |
| 1973 | the bottom-most frame. This lets you jump back and execute |
| 1974 | code again, or jump forward to skip code that you don't want |
| 1975 | to run. |
| 1976 | |
| 1977 | It should be noted that not all jumps are allowed -- for |
| 1978 | instance it is not possible to jump into the middle of a |
| 1979 | for loop or out of a finally clause. |
| 1980 | """ |
| 1981 | if not arg: |
| 1982 | self._print_invalid_arg(arg) |
| 1983 | return |
| 1984 | if self.curindex + 1 != len(self.stack): |
| 1985 | self.error('You can only jump within the bottom frame') |
| 1986 | return |
| 1987 | try: |
| 1988 | arg = int(arg) |
| 1989 | except ValueError: |
| 1990 | self.error("The 'jump' command requires a line number") |
| 1991 | else: |
| 1992 | try: |
| 1993 | # Do the jump, fix up our copy of the stack, and display the |
| 1994 | # new position |
| 1995 | self.curframe.f_lineno = arg |
| 1996 | self.stack[self.curindex] = self.stack[self.curindex][0], arg |
| 1997 | self.print_stack_entry(self.stack[self.curindex]) |
| 1998 | except ValueError as e: |
| 1999 | self.error('Jump failed: %s' % e) |
| 2000 | do_j = do_jump |
| 2001 | |
| 2002 | def _create_recursive_debugger(self): |
nothing calls this directly
no test coverage detected