More xdis upgrade fixes...

LOAD_CONST of unicode in 2.7- is the same thing as LOAD_STR.

I guess previously there was no unicode.
This commit is contained in:
rocky
2020-04-18 22:26:24 -04:00
parent 9ca94717e0
commit 999eee4b5f
2 changed files with 1 additions and 1 deletions

View File

@@ -379,7 +379,7 @@ class Scanner3(Scanner):
# pattr = 'code_object @ 0x%x %s->%s' %\
# (id(const), const.co_filename, const.co_name)
pattr = "<code_object " + const.co_name + ">"
elif isinstance(const, str):
elif isinstance(const, str) or xdis.PYTHON_VERSION <= 2.7 and isinstance(const, unicode):
opname = "LOAD_STR"
else:
if isinstance(inst.arg, int) and inst.arg < len(co.co_consts):