Start using our replacement for inspect.iscode

This commit is contained in:
rocky
2015-12-30 18:43:22 -05:00
parent 5bbe2c4a45
commit 2e91de8355
10 changed files with 90 additions and 64 deletions

View File

@@ -15,6 +15,7 @@ from array import array
import uncompyle6.scanners.scanner3 as scan3
from uncompyle6 import PYTHON_VERSION
from uncompyle6.code import iscode
from uncompyle6.scanner import Token
# Get all the opcodes into globals
@@ -92,13 +93,9 @@ class Scanner34(scan3.Scanner3):
pattr = inst.argrepr
opname = inst.opname
# For constants, the pattr is the same as attr. Using pattr adds
# an extra level of quotes which messes other things up, like getting
# keyword attribute names in a call. I suspect there will be things
# other than LOAD_CONST, but we'll start out with just this for now.
if opname in ['LOAD_CONST']:
const = inst.argval
if hasattr(const, 'co_name'):
if iscode(const):
if const.co_name == '<lambda>':
opname = 'LOAD_LAMBDA'
elif const.co_name == '<genexpr>':