|
|
|
@ -145,24 +145,24 @@ LOAD_CONST = dis.opname.index('LOAD_CONST')
|
|
|
|
IMPORT_NAME = dis.opname.index('IMPORT_NAME')
|
|
|
|
IMPORT_NAME = dis.opname.index('IMPORT_NAME')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _getarg(c):
|
|
|
|
|
|
|
|
if c < dis.HAVE_ARGUMENT:
|
|
|
|
|
|
|
|
return nextb()
|
|
|
|
|
|
|
|
return nextb() | (nextb() << 8)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if sys.version_info < (3, 0):
|
|
|
|
if sys.version_info < (3, 0):
|
|
|
|
def iter_opcodes(co):
|
|
|
|
def iter_opcodes(co):
|
|
|
|
# Yield `(op, oparg)` tuples from the code object `co`.
|
|
|
|
# Yield `(op, oparg)` tuples from the code object `co`.
|
|
|
|
ordit = imap(ord, co.co_code)
|
|
|
|
ordit = imap(ord, co.co_code)
|
|
|
|
nextb = ordit.next
|
|
|
|
nextb = ordit.next
|
|
|
|
return ((c, (None
|
|
|
|
return ((c, _getarg(c)) for c in ordit)
|
|
|
|
if c < dis.HAVE_ARGUMENT else
|
|
|
|
|
|
|
|
(nextb() | (nextb() << 8))))
|
|
|
|
|
|
|
|
for c in ordit)
|
|
|
|
|
|
|
|
elif sys.version_info < (3, 6):
|
|
|
|
elif sys.version_info < (3, 6):
|
|
|
|
def iter_opcodes(co):
|
|
|
|
def iter_opcodes(co):
|
|
|
|
# Yield `(op, oparg)` tuples from the code object `co`.
|
|
|
|
# Yield `(op, oparg)` tuples from the code object `co`.
|
|
|
|
ordit = iter(co.co_code)
|
|
|
|
ordit = iter(co.co_code)
|
|
|
|
nextb = ordit.__next__
|
|
|
|
nextb = ordit.__next__
|
|
|
|
return ((c, (None
|
|
|
|
return ((c, _getarg(c)) for c in ordit)
|
|
|
|
if c < dis.HAVE_ARGUMENT else
|
|
|
|
|
|
|
|
(nextb() | (nextb() << 8))))
|
|
|
|
|
|
|
|
for c in ordit)
|
|
|
|
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
def iter_opcodes(co):
|
|
|
|
def iter_opcodes(co):
|
|
|
|
# Yield `(op, oparg)` tuples from the code object `co`.
|
|
|
|
# Yield `(op, oparg)` tuples from the code object `co`.
|
|
|
|
|