inspect.iscode -> hasattr for now until we write a cross-version iscode

This commit is contained in:
rocky
2015-12-29 17:05:48 -05:00
parent 34841abe14
commit 116263dd8c
3 changed files with 6 additions and 6 deletions

View File

@@ -98,7 +98,7 @@ class Scanner34(scan3.Scanner3):
# other than LOAD_CONST, but we'll start out with just this for now.
if opname in ['LOAD_CONST']:
const = inst.argval
if inspect.iscode(const):
if hasattr(const, 'co_name')):
if const.co_name == '<lambda>':
opname = 'LOAD_LAMBDA'
elif const.co_name == '<genexpr>':