| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1182,7 +1182,7 @@ def _prepare_test_cases(): | |||
| 1182 | 1182 | Instruction(opname='CALL_NO_KW', opcode=169, arg=1, argval=1, argrepr='', offset=130, starts_line=None, is_jump_target=False, positions=None), | |
| 1183 | 1183 | Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=132, starts_line=None, is_jump_target=False, positions=None), | |
| 1184 | 1184 | Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=134, starts_line=None, is_jump_target=False, positions=None), | |
| 1185 | - Instruction(opname='JUMP_FORWARD', opcode=110, arg=34, argval=206, argrepr='to 206', offset=136, starts_line=None, is_jump_target=False, positions=None), | ||
| 1185 | + Instruction(opname='JUMP_FORWARD', opcode=110, arg=35, argval=208, argrepr='to 208', offset=136, starts_line=None, is_jump_target=False, positions=None), | ||
| 1186 | 1186 | Instruction(opname='RERAISE', opcode=119, arg=0, argval=0, argrepr='', offset=138, starts_line=22, is_jump_target=True, positions=None), | |
| 1187 | 1187 | Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=140, starts_line=None, is_jump_target=False, positions=None), | |
| 1188 | 1188 | Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=142, starts_line=None, is_jump_target=False, positions=None), | |
@@ -1199,7 +1199,7 @@ def _prepare_test_cases(): | |||
| 1199 | 1199 | Instruction(opname='DUP_TOP', opcode=4, arg=None, argval=None, argrepr='', offset=164, starts_line=None, is_jump_target=False, positions=None), | |
| 1200 | 1200 | Instruction(opname='CALL_NO_KW', opcode=169, arg=3, argval=3, argrepr='', offset=166, starts_line=None, is_jump_target=False, positions=None), | |
| 1201 | 1201 | Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=168, starts_line=None, is_jump_target=False, positions=None), | |
| 1202 | - Instruction(opname='JUMP_FORWARD', opcode=110, arg=11, argval=194, argrepr='to 194', offset=170, starts_line=None, is_jump_target=False, positions=None), | ||
| 1202 | + Instruction(opname='JUMP_FORWARD', opcode=110, arg=25, argval=222, argrepr='to 222', offset=170, starts_line=None, is_jump_target=False, positions=None), | ||
| 1203 | 1203 | Instruction(opname='PUSH_EXC_INFO', opcode=35, arg=None, argval=None, argrepr='', offset=172, starts_line=None, is_jump_target=False, positions=None), | |
| 1204 | 1204 | Instruction(opname='WITH_EXCEPT_START', opcode=49, arg=None, argval=None, argrepr='', offset=174, starts_line=None, is_jump_target=False, positions=None), | |
| 1205 | 1205 | Instruction(opname='POP_JUMP_IF_TRUE', opcode=115, arg=93, argval=186, argrepr='to 186', offset=176, starts_line=None, is_jump_target=False, positions=None), | |
@@ -1211,28 +1211,36 @@ def _prepare_test_cases(): | |||
| 1211 | 1211 | Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=188, starts_line=None, is_jump_target=False, positions=None), | |
| 1212 | 1212 | Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=190, starts_line=None, is_jump_target=False, positions=None), | |
| 1213 | 1213 | Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=192, starts_line=None, is_jump_target=False, positions=None), | |
| 1214 | - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=194, starts_line=28, is_jump_target=True, positions=None), | ||
| 1215 | - Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=196, starts_line=None, is_jump_target=False, positions=None), | ||
| 1216 | - Instruction(opname='CALL_NO_KW', opcode=169, arg=1, argval=1, argrepr='', offset=198, starts_line=None, is_jump_target=False, positions=None), | ||
| 1217 | - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=200, starts_line=None, is_jump_target=False, positions=None), | ||
| 1218 | - Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=202, starts_line=None, is_jump_target=False, positions=None), | ||
| 1219 | - Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=204, starts_line=None, is_jump_target=False, positions=None), | ||
| 1220 | - Instruction(opname='NOP', opcode=9, arg=None, argval=None, argrepr='', offset=206, starts_line=23, is_jump_target=True, positions=None), | ||
| 1221 | - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=208, starts_line=28, is_jump_target=False, positions=None), | ||
| 1222 | - Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=210, starts_line=None, is_jump_target=False, positions=None), | ||
| 1223 | - Instruction(opname='CALL_NO_KW', opcode=169, arg=1, argval=1, argrepr='', offset=212, starts_line=None, is_jump_target=False, positions=None), | ||
| 1224 | - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=214, starts_line=None, is_jump_target=False, positions=None), | ||
| 1225 | - Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=216, starts_line=None, is_jump_target=False, positions=None), | ||
| 1226 | - Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=218, starts_line=None, is_jump_target=False, positions=None), | ||
| 1227 | - Instruction(opname='PUSH_EXC_INFO', opcode=35, arg=None, argval=None, argrepr='', offset=220, starts_line=None, is_jump_target=False, positions=None), | ||
| 1228 | - Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=222, starts_line=None, is_jump_target=False, positions=None), | ||
| 1229 | - Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=224, starts_line=None, is_jump_target=False, positions=None), | ||
| 1230 | - Instruction(opname='CALL_NO_KW', opcode=169, arg=1, argval=1, argrepr='', offset=226, starts_line=None, is_jump_target=False, positions=None), | ||
| 1231 | - Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=228, starts_line=None, is_jump_target=False, positions=None), | ||
| 1232 | - Instruction(opname='RERAISE', opcode=119, arg=0, argval=0, argrepr='', offset=230, starts_line=None, is_jump_target=False, positions=None), | ||
| 1233 | - Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=232, starts_line=None, is_jump_target=False, positions=None), | ||
| 1234 | - Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=234, starts_line=None, is_jump_target=False, positions=None), | ||
| 1235 | - Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=236, starts_line=None, is_jump_target=False, positions=None), | ||
| 1214 | + Instruction(opname='NOP', opcode=9, arg=None, argval=None, argrepr='', offset=194, starts_line=None, is_jump_target=False, positions=None), | ||
| 1215 | + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=196, starts_line=28, is_jump_target=False, positions=None), | ||
| 1216 | + Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=198, starts_line=None, is_jump_target=False, positions=None), | ||
| 1217 | + Instruction(opname='CALL_NO_KW', opcode=169, arg=1, argval=1, argrepr='', offset=200, starts_line=None, is_jump_target=False, positions=None), | ||
| 1218 | + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=202, starts_line=None, is_jump_target=False, positions=None), | ||
| 1219 | + Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=204, starts_line=None, is_jump_target=False, positions=None), | ||
| 1220 | + Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=206, starts_line=None, is_jump_target=False, positions=None), | ||
| 1221 | + Instruction(opname='NOP', opcode=9, arg=None, argval=None, argrepr='', offset=208, starts_line=23, is_jump_target=True, positions=None), | ||
| 1222 | + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=210, starts_line=28, is_jump_target=False, positions=None), | ||
| 1223 | + Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=212, starts_line=None, is_jump_target=False, positions=None), | ||
| 1224 | + Instruction(opname='CALL_NO_KW', opcode=169, arg=1, argval=1, argrepr='', offset=214, starts_line=None, is_jump_target=False, positions=None), | ||
| 1225 | + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=216, starts_line=None, is_jump_target=False, positions=None), | ||
| 1226 | + Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=218, starts_line=None, is_jump_target=False, positions=None), | ||
| 1227 | + Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=220, starts_line=None, is_jump_target=False, positions=None), | ||
| 1228 | + Instruction(opname='NOP', opcode=9, arg=None, argval=None, argrepr='', offset=222, starts_line=25, is_jump_target=True, positions=None), | ||
| 1229 | + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=224, starts_line=28, is_jump_target=False, positions=None), | ||
| 1230 | + Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=226, starts_line=None, is_jump_target=False, positions=None), | ||
| 1231 | + Instruction(opname='CALL_NO_KW', opcode=169, arg=1, argval=1, argrepr='', offset=228, starts_line=None, is_jump_target=False, positions=None), | ||
| 1232 | + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=230, starts_line=None, is_jump_target=False, positions=None), | ||
| 1233 | + Instruction(opname='LOAD_CONST', opcode=100, arg=0, argval=None, argrepr='None', offset=232, starts_line=None, is_jump_target=False, positions=None), | ||
| 1234 | + Instruction(opname='RETURN_VALUE', opcode=83, arg=None, argval=None, argrepr='', offset=234, starts_line=None, is_jump_target=False, positions=None), | ||
| 1235 | + Instruction(opname='PUSH_EXC_INFO', opcode=35, arg=None, argval=None, argrepr='', offset=236, starts_line=None, is_jump_target=False, positions=None), | ||
| 1236 | + Instruction(opname='LOAD_GLOBAL', opcode=116, arg=1, argval='print', argrepr='print', offset=238, starts_line=None, is_jump_target=False, positions=None), | ||
| 1237 | + Instruction(opname='LOAD_CONST', opcode=100, arg=10, argval="OK, now we're done", argrepr='"OK, now we\'re done"', offset=240, starts_line=None, is_jump_target=False, positions=None), | ||
| 1238 | + Instruction(opname='CALL_NO_KW', opcode=169, arg=1, argval=1, argrepr='', offset=242, starts_line=None, is_jump_target=False, positions=None), | ||
| 1239 | + Instruction(opname='POP_TOP', opcode=1, arg=None, argval=None, argrepr='', offset=244, starts_line=None, is_jump_target=False, positions=None), | ||
| 1240 | + Instruction(opname='RERAISE', opcode=119, arg=0, argval=0, argrepr='', offset=246, starts_line=None, is_jump_target=False, positions=None), | ||
| 1241 | + Instruction(opname='COPY', opcode=120, arg=3, argval=3, argrepr='', offset=248, starts_line=None, is_jump_target=False, positions=None), | ||
| 1242 | + Instruction(opname='POP_EXCEPT', opcode=89, arg=None, argval=None, argrepr='', offset=250, starts_line=None, is_jump_target=False, positions=None), | ||
| 1243 | + Instruction(opname='RERAISE', opcode=119, arg=1, argval=1, argrepr='', offset=252, starts_line=None, is_jump_target=False, positions=None), | ||
| 1236 | 1244 | ] | |
| 1237 | 1245 | ||
| 1238 | 1246 | # One last piece of inspect fodder to check the default line number handling | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -644,16 +644,25 @@ def func(): | |||
| 644 | 644 | 4 | |
| 645 | 645 | else: | |
| 646 | 646 | 6 | |
| 647 | + if False: | ||
| 648 | + 8 | ||
| 649 | + else: | ||
| 650 | + 10 | ||
| 651 | + if func.__name__ == 'Fred': | ||
| 652 | + 12 | ||
| 647 | 653 | finally: | |
| 648 | - 8 | ||
| 654 | + 14 | ||
| 649 | 655 | ||
| 650 | 656 | self.run_and_compare(func, | |
| 651 | 657 | [(0, 'call'), | |
| 652 | 658 | (1, 'line'), | |
| 653 | 659 | (2, 'line'), | |
| 654 | 660 | (6, 'line'), | |
| 655 | - (8, 'line'), | ||
| 656 | - (8, 'return')]) | ||
| 661 | + (7, 'line'), | ||
| 662 | + (10, 'line'), | ||
| 663 | + (11, 'line'), | ||
| 664 | + (14, 'line'), | ||
| 665 | + (14, 'return')]) | ||
| 657 | 666 | ||
| 658 | 667 | def test_nested_loops(self): | |
| 659 | 668 | ||
@@ -1222,16 +1231,25 @@ def func(): | |||
| 1222 | 1231 | 4 | |
| 1223 | 1232 | else: | |
| 1224 | 1233 | 6 | |
| 1234 | + if False: | ||
| 1235 | + 8 | ||
| 1236 | + else: | ||
| 1237 | + 10 | ||
| 1238 | + if func.__name__ == 'Fred': | ||
| 1239 | + 12 | ||
| 1225 | 1240 | finally: | |
| 1226 | - 8 | ||
| 1241 | + 14 | ||
| 1227 | 1242 | ||
| 1228 | 1243 | self.run_and_compare(func, | |
| 1229 | 1244 | [(0, 'call'), | |
| 1230 | 1245 | (1, 'line'), | |
| 1231 | 1246 | (2, 'line'), | |
| 1232 | 1247 | (6, 'line'), | |
| 1233 | - (8, 'line'), | ||
| 1234 | - (8, 'return')]) | ||
| 1248 | + (7, 'line'), | ||
| 1249 | + (10, 'line'), | ||
| 1250 | + (11, 'line'), | ||
| 1251 | + (14, 'line'), | ||
| 1252 | + (14, 'return')]) | ||
| 1235 | 1253 | ||
| 1236 | 1254 | def test_try_except_star_named_no_exception(self): | |
| 1237 | 1255 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3475,7 +3475,6 @@ compiler_try_except(struct compiler *c, stmt_ty s) | |||
| 3475 | 3475 | POP_EXCEPT_AND_RERAISE(c); | |
| 3476 | 3476 | compiler_use_next_block(c, orelse); | |
| 3477 | 3477 | VISIT_SEQ(c, stmt, s->v.Try.orelse); | |
| 3478 | - ADDOP_JUMP(c, JUMP_FORWARD, end); | ||
| 3479 | 3478 | compiler_use_next_block(c, end); | |
| 3480 | 3479 | return 1; | |
| 3481 | 3480 | } | |
@@ -3702,7 +3701,6 @@ compiler_try_star_except(struct compiler *c, stmt_ty s) | |||
| 3702 | 3701 | POP_EXCEPT_AND_RERAISE(c); | |
| 3703 | 3702 | compiler_use_next_block(c, orelse); | |
| 3704 | 3703 | VISIT_SEQ(c, stmt, s->v.TryStar.orelse); | |
| 3705 | - ADDOP_JUMP(c, JUMP_FORWARD, end); | ||
| 3706 | 3704 | compiler_use_next_block(c, end); | |
| 3707 | 3705 | return 1; | |
| 3708 | 3706 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments