You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
disassemble -> ingest where appropriate
As part of tokenization for (de)parsing, we need to do something like a disassembly, but is is really a little different. Disassembly, strictly speaking, is done by the xdis module now. What "ingestion" does is massage the instruction tokens to a form that is more amenable for parsing. In sum, ingestion is different than disassembly, although disassembly is generally the first part of ingestion.
This commit is contained in:
@@ -229,10 +229,10 @@ def cmp_code_objects(version, is_pypy, code_obj1, code_obj2,
|
||||
# which would get confusing.
|
||||
scanner.setTokenClass(Token)
|
||||
try:
|
||||
# disassemble both code-objects
|
||||
tokens1, customize = scanner.disassemble(code_obj1)
|
||||
# ingest both code-objects
|
||||
tokens1, customize = scanner.ingest(code_obj1)
|
||||
del customize # save memory
|
||||
tokens2, customize = scanner.disassemble(code_obj2)
|
||||
tokens2, customize = scanner.ingest(code_obj2)
|
||||
del customize # save memory
|
||||
finally:
|
||||
scanner.resetTokenClass() # restore Token class
|
||||
|
Reference in New Issue
Block a user