You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
tok.format -> tok.__str__; simplify pypy code
This commit is contained in:
@@ -130,10 +130,13 @@ class Scanner3(scan.Scanner):
|
||||
for instr in bytecode.get_instructions(co):
|
||||
print(instr._disassemble())
|
||||
|
||||
customize = {}
|
||||
# Container for tokens
|
||||
tokens = []
|
||||
|
||||
customize = {}
|
||||
if self.is_pypy:
|
||||
customize['PyPy'] = 1;
|
||||
|
||||
self.code = array('B', co.co_code)
|
||||
self.build_lines_data(co)
|
||||
self.build_prev_op()
|
||||
@@ -307,7 +310,7 @@ class Scanner3(scan.Scanner):
|
||||
|
||||
if show_asm in ('both', 'after'):
|
||||
for t in tokens:
|
||||
print(t.format())
|
||||
print(t)
|
||||
print()
|
||||
return tokens, customize
|
||||
|
||||
@@ -801,7 +804,7 @@ if __name__ == "__main__":
|
||||
from uncompyle6 import PYTHON_VERSION
|
||||
tokens, customize = Scanner3(PYTHON_VERSION).disassemble(co)
|
||||
for t in tokens:
|
||||
print(t.format())
|
||||
print(t)
|
||||
else:
|
||||
print("Need to be Python 3.2 or greater to demo; I am %s." %
|
||||
PYTHON_VERSION)
|
||||
|
Reference in New Issue
Block a user