Expand Up @@ -369,15 +369,12 @@ def bug42562(): %3d LOAD_FAST 1 (tb) RETURN_VALUE >> COPY 3 POP_EXCEPT RERAISE 1 >> PUSH_EXC_INFO %3d LOAD_GLOBAL 0 (Exception) CHECK_EXC_MATCH POP_JUMP_FORWARD_IF_FALSE 18 (to78 ) STORE_FAST 0 (e) POP_JUMP_FORWARD_IF_FALSE 18 (to72 ) STORE_FAST 0 (e) %3d LOAD_FAST 0 (e) LOAD_ATTR 1 (__traceback__) Expand All @@ -394,7 +391,10 @@ def bug42562(): DELETE_FAST 0 (e) RERAISE 1 %3d >> RERAISE 0 %3d >> RERAISE 0 >> COPY 3 POP_EXCEPT RERAISE 1 ExceptionTable: """ % (TRACEBACK_CODE.co_firstlineno, TRACEBACK_CODE.co_firstlineno + 1, Expand Down Expand Up @@ -1478,47 +1478,40 @@ def _prepare_test_cases(): Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=322, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=324, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=326, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_GLOBAL ', opcode=116 , arg=3 , argval='print' , argrepr='NULL + print ', offset=328, starts_line=28 , is_jump_target=True, positions=None), Instruction(opname='LOAD_CONST ', opcode=100 , arg=10 , argval="OK, now we're done", argrepr='"OK, now we\'re done"' , offset=340 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='PRECALL ', opcode=166 , arg=1 , argval=1 , argrepr='', offset=342 , starts_line=None , is_jump_target=False, positions=None), Instruction(opname='CALL ', opcode=171 , arg=1 , argval=1 , argrepr='', offset=346 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_TOP ', opcode=1 , arg=None , argval=None , argrepr='', offset=356 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_CONST ', opcode=100 , arg=0 , argval=None, argrepr='None ', offset=358 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='RETURN_VALUE ', opcode=83 , arg=None , argval=None , argrepr='', offset=360 , starts_line=None , is_jump_target=False, positions=None), Instruction(opname='NOP ', opcode=9 , arg=None , argval=None, argrepr='' , offset=362, starts_line=23 , is_jump_target=True , positions=None), Instruction(opname='LOAD_GLOBAL ', opcode=116 , arg=3 , argval='print' , argrepr='NULL + print ', offset=364, starts_line=28 , is_jump_target=False, positions=None), Instruction(opname='LOAD_CONST ', opcode=100 , arg=10 , argval="OK, now we're done", argrepr='"OK, now we\'re done"' , offset=376 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='PRECALL ', opcode=166 , arg=1 , argval=1 , argrepr='', offset=378, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='CALL ', opcode=171 , arg=1 , argval=1 , argrepr='', offset=382 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_TOP ', opcode=1 , arg=None , argval=None , argrepr='', offset=392 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_CONST ', opcode=100 , arg=0, argval=None , argrepr='None ', offset=394 , starts_line=None , is_jump_target=False , positions=None), Instruction(opname='RETURN_VALUE ', opcode=83 , arg=None , argval=None , argrepr='', offset=396 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='PUSH_EXC_INFO ', opcode=35 , arg=None, argval=None, argrepr='', offset=398 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_GLOBAL ', opcode=116 , arg=3 , argval='print' , argrepr='NULL + print ', offset=400 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_CONST ', opcode=100 , arg=10 , argval="OK, now we're done" , argrepr='"OK, now we\'re done"' , offset=412 , starts_line=None , is_jump_target=False , positions=None), Instruction(opname='PRECALL ', opcode=166 , arg=1 , argval=1, argrepr='' , offset=414 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='CALL ', opcode=171 , arg=1, argval=1, argrepr='', offset=418 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_TOP ', opcode=1 , arg=None , argval=None , argrepr='', offset=428 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='RERAISE ', opcode=119 , arg=0 , argval=0 , argrepr='', offset=430 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='COPY ', opcode=120 , arg=3 , argval=3 , argrepr='', offset=432 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_EXCEPT ', opcode=89 , arg=None, argval=None, argrepr='', offset=434 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='RERAISE ', opcode=119 , arg=1 , argval=1 , argrepr='', offset=436 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='PUSH_EXC_INFO ', opcode=35 , arg=None , argval=None , argrepr='', offset=438 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_GLOBAL ', opcode=116 , arg=4 , argval='ZeroDivisionError' , argrepr='ZeroDivisionError' , offset=440, starts_line=22 , is_jump_target=False, positions=None), Instruction(opname='CHECK_EXC_MATCH ', opcode=36 , arg=None , argval=None , argrepr='', offset=452 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_JUMP_FORWARD_IF_FALSE ', opcode=114 , arg=18 , argval=492 , argrepr='to 492 ', offset=454 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='JUMP_FORWARD ', opcode=110 , arg=31 , argval=392 , argrepr='to 392 ', offset=328, starts_line=None , is_jump_target=True, positions=None), Instruction(opname='PUSH_EXC_INFO ', opcode=35 , arg=None , argval=None, argrepr='' , offset=330 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_GLOBAL ', opcode=116 , arg=4 , argval='ZeroDivisionError' , argrepr='ZeroDivisionError ', offset=332 , starts_line=22 , is_jump_target=False, positions=None), Instruction(opname='CHECK_EXC_MATCH ', opcode=36 , arg=None , argval=None , argrepr='', offset=344 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_JUMP_FORWARD_IF_FALSE ', opcode=114 , arg=18 , argval=384 , argrepr='to 384 ', offset=346 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_TOP ', opcode=1 , arg=None , argval=None, argrepr='', offset=348 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_GLOBAL ', opcode=116 , arg=3 , argval='print' , argrepr='NULL + print ', offset=350 , starts_line=23 , is_jump_target=False, positions=None), Instruction(opname='LOAD_CONST ', opcode=100 , arg=9 , argval='Here we go, here we go, here we go...', argrepr="'Here we go, here we go, here we go...'" , offset=362, starts_line=None , is_jump_target=False , positions=None), Instruction(opname='PRECALL ', opcode=166 , arg=1 , argval=1 , argrepr='', offset=364, starts_line=None , is_jump_target=False, positions=None), Instruction(opname='CALL ', opcode=171 , arg=1 , argval=1, argrepr='' , offset=368 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_TOP ', opcode=1 , arg=None , argval=None , argrepr='', offset=378, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_EXCEPT ', opcode=89 , arg=None , argval=None , argrepr='', offset=380 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='JUMP_FORWARD ', opcode=110 , arg=4 , argval=392 , argrepr='to 392 ', offset=382 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='RERAISE ', opcode=119 , arg=0, argval=0 , argrepr='', offset=384 , starts_line=22 , is_jump_target=True , positions=None), Instruction(opname='COPY ', opcode=120 , arg=3 , argval=3 , argrepr='', offset=386 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_EXCEPT ', opcode=89 , arg=None, argval=None, argrepr='', offset=388 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='RERAISE ', opcode=119 , arg=1 , argval=1 , argrepr='', offset=390 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_GLOBAL ', opcode=116 , arg=3 , argval='print' , argrepr='NULL + print' , offset=392 , starts_line=28 , is_jump_target=True , positions=None), Instruction(opname='LOAD_CONST ', opcode=100 , arg=10 , argval="OK, now we're done", argrepr='"OK, now we\'re done"' , offset=404 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='PRECALL ', opcode=166 , arg=1, argval=1, argrepr='', offset=406 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='CALL ', opcode=171 , arg=1 , argval=1 , argrepr='', offset=410 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_TOP ', opcode=1 , arg=None , argval=None , argrepr='', offset=420 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_CONST ', opcode=100 , arg=0 , argval=None , argrepr='None ', offset=422 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='RETURN_VALUE ', opcode=83 , arg=None, argval=None, argrepr='', offset=424 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='PUSH_EXC_INFO ', opcode=35 , arg=None , argval=None , argrepr='', offset=426 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_GLOBAL ', opcode=116 , arg=3 , argval='print' , argrepr='NULL + print ', offset=428 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_CONST ', opcode=100 , arg=10 , argval="OK, now we're done" , argrepr='"OK, now we\'re done"' , offset=440, starts_line=None , is_jump_target=False, positions=None), Instruction(opname='PRECALL ', opcode=166 , arg=1 , argval=1 , argrepr='', offset=442 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='CALL ', opcode=171 , arg=1 , argval=1 , argrepr='', offset=446 , starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=456, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='LOAD_GLOBAL', opcode=116, arg=3, argval='print', argrepr='NULL + print', offset=458, starts_line=23, is_jump_target=False, positions=None), Instruction(opname='LOAD_CONST', opcode=100, arg=9, argval='Here we go, here we go, here we go...', argrepr="'Here we go, here we go, here we go...'", offset=470, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='PRECALL', opcode=166, arg=1, argval=1, argrepr='', offset=472, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='CALL', opcode=171, arg=1, argval=1, argrepr='', offset=476, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=486, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=488, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='JUMP_BACKWARD', opcode=140, arg=65, argval=362, argrepr='to 362', offset=490, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='RERAISE', opcode=119, arg=0, argval=0, argrepr='', offset=492, starts_line=22, is_jump_target=True, positions=None), Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=494, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=496, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=498, starts_line=None, is_jump_target=False, positions=None) Instruction(opname='RERAISE', opcode=119, arg=0, argval=0, argrepr='', offset=458, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=460, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=462, starts_line=None, is_jump_target=False, positions=None), Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=464, starts_line=None, is_jump_target=False, positions=None), ] # One last piece of inspect fodder to check the default line number handling Expand Down