tozqo, thank you for the input. If I run the code posted in the beginning, it will work only until the program gets to the os._exit(1). We are trying to use the Pdb class to skip this line, but that is where I am having issues. For some reason if I initialize stack =pdb.Pdb() and then try to call stack.do_jump(line=11) I get the attribute error stated above. Do you have any ideas why it would say AttributeError: 'Pdb' object has no attribute 'curindex'? (For continuity sake, I made my code look similar to the one in the initial post so we could all brainstorm how to work past the conceptual problem)
frame = inspect.currentframe()
stack = pdb.Pdb()
def tracefunc(frame, event, arg):
if event == "line":
if frame.f_code.co_name == 'game_over':
func = frame
print("============"+func.f_code.co_name+"==============")
stack.do_jump(11)
return tracefunc
sys.settrace(tracefunc)
frame = inspect.currentframe()
stack = pdb.Pdb()
def tracefunc(frame, event, arg):
if event == "line":
if frame.f_code.co_name == 'game_over':
func = frame
print("============"+func.f_code.co_name+"==============")
stack.do_jump(11)
return tracefunc
sys.settrace(tracefunc)