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.parser import PythonParser, PythonParserSingle, nop_func
|
||||||
from uncompyle6.parsers.astnode import AST
|
from uncompyle6.parsers.astnode import AST
|
||||||
from spark_parser import DEFAULT_DEBUG as PARSER_DEFAULT_DEBUG
|
from spark_parser import DEFAULT_DEBUG as PARSER_DEFAULT_DEBUG
|
||||||
|
from xdis import PYTHON3
|
||||||
|
|
||||||
class Python3Parser(PythonParser):
|
class Python3Parser(PythonParser):
|
||||||
|
|
||||||
@@ -890,6 +891,9 @@ class Python3Parser(PythonParser):
|
|||||||
return not isinstance(tokens[first].attr, tuple)
|
return not isinstance(tokens[first].attr, tuple)
|
||||||
elif lhs == 'kwarg':
|
elif lhs == 'kwarg':
|
||||||
arg = tokens[first].attr
|
arg = tokens[first].attr
|
||||||
|
if PYTHON3:
|
||||||
|
return not isinstance(arg, str)
|
||||||
|
else:
|
||||||
return not (isinstance(arg, str) or isinstance(arg, unicode))
|
return not (isinstance(arg, str) or isinstance(arg, unicode))
|
||||||
elif lhs == 'while1elsestmt':
|
elif lhs == 'while1elsestmt':
|
||||||
# if SETUP_LOOP target spans the else part, then this is
|
# if SETUP_LOOP target spans the else part, then this is
|
||||||
|
Reference in New Issue
Block a user