You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
No unicode in Python3.
but we need it in Python2. The bug was probably introduced as a result of recent Python code type unteroperability canonicalization
This commit is contained in:
@@ -20,6 +20,7 @@ from __future__ import print_function
|
||||
from uncompyle6.parser import PythonParser, PythonParserSingle, nop_func
|
||||
from uncompyle6.parsers.astnode import AST
|
||||
from spark_parser import DEFAULT_DEBUG as PARSER_DEFAULT_DEBUG
|
||||
from xdis import PYTHON3
|
||||
|
||||
class Python3Parser(PythonParser):
|
||||
|
||||
@@ -890,7 +891,10 @@ class Python3Parser(PythonParser):
|
||||
return not isinstance(tokens[first].attr, tuple)
|
||||
elif lhs == 'kwarg':
|
||||
arg = tokens[first].attr
|
||||
return not (isinstance(arg, str) or isinstance(arg, unicode))
|
||||
if PYTHON3:
|
||||
return not isinstance(arg, str)
|
||||
else:
|
||||
return not (isinstance(arg, str) or isinstance(arg, unicode))
|
||||
elif lhs == 'while1elsestmt':
|
||||
# if SETUP_LOOP target spans the else part, then this is
|
||||
# not while1else. Also do for whileTrue?
|
||||
|
Reference in New Issue
Block a user