verify scanner2 vs scanner3 small changes...

verify.py: allow LOAD_CONST None to make LOAD_NAME 'None'
scanner{2,3}.py: make them look more alike
This commit is contained in:
rocky
2016-11-17 03:43:39 -05:00
parent 31d387749b
commit 76ae1592d0
3 changed files with 28 additions and 20 deletions

View File

@@ -403,12 +403,13 @@ class Scanner3(Scanner):
def find_jump_targets(self):
"""
Detect all offsets in a byte code which are jump targets.
Detect all offsets in a byte code which are jump targets
where we might insert a COME_FROM instruction.
Return the list of offsets.
This procedure is modelled after dis.findlabels(), but here
for each target the number of jumps is counted.
Return the list of offsets. An instruction can be jumped
to in from multiple instructions.
"""
code = self.code
n = len(code)