You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Merge branch 'master' into python-2.4
This commit is contained in:
@@ -32,14 +32,16 @@ SKIP_TESTS=(
|
|||||||
[test_doctest2.py]=1 # FIXME: assert failure - works on decompyle3
|
[test_doctest2.py]=1 # FIXME: assert failure - works on decompyle3
|
||||||
[test_docxmlrpc.py]=1
|
[test_docxmlrpc.py]=1
|
||||||
[test_enum.py]=1 # probably bad control flow
|
[test_enum.py]=1 # probably bad control flow
|
||||||
|
|
||||||
[test_faulthandler.py]=1 # takes too long
|
[test_faulthandler.py]=1 # takes too long
|
||||||
[test_fcntl.py]=1
|
[test_fcntl.py]=1
|
||||||
[test_fileinput.py]=1 # Test assertion failures
|
[test_fileinput.py]=1 # Test assertion failures
|
||||||
[test_format.py]=1 # Probably not handling bytestrings properly
|
[test_format.py]=1 # Probably not handling bytestrings properly
|
||||||
[test_frame.py]=1 # test assertion errors
|
[test_frame.py]=1 # test assertion errors
|
||||||
[test_ftplib.py]=1 # parse error
|
[test_ftplib.py]=1 # parse error
|
||||||
[test_functools.py]=1 # parse error
|
|
||||||
[test_fstring.py]=1 # need to disambiguate leading fstrings from docstrings
|
[test_fstring.py]=1 # need to disambiguate leading fstrings from docstrings
|
||||||
|
[test_functools.py]=1 # parse error
|
||||||
|
|
||||||
[test_gdb.py]=1 # it fails on its own
|
[test_gdb.py]=1 # it fails on its own
|
||||||
[test_generators.py]=1 # Investigate improper lamdba with bogus "False" added
|
[test_generators.py]=1 # Investigate improper lamdba with bogus "False" added
|
||||||
[test_glob.py]=1 # TypeError: join() argument must be str or bytes, not 'tuple'
|
[test_glob.py]=1 # TypeError: join() argument must be str or bytes, not 'tuple'
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
SKIP_TESTS=(
|
SKIP_TESTS=(
|
||||||
[test___all__.py]=1 # it fails on its own
|
[test___all__.py]=1 # it fails on its own
|
||||||
|
[test_aifc.py]=1 # parse error
|
||||||
[test_argparse.py]=1 #- it fails on its own
|
[test_argparse.py]=1 #- it fails on its own
|
||||||
|
[test_array.py]=1 #- parse error
|
||||||
[test_asdl_parser.py]=1 # it fails on its own
|
[test_asdl_parser.py]=1 # it fails on its own
|
||||||
[test_ast.py]=1 # Depends on comments in code
|
[test_ast.py]=1 # Depends on comments in code
|
||||||
[test_atexit.py]=1 # The atexit test looks for specific comments in error lines
|
[test_atexit.py]=1 # The atexit test looks for specific comments in error lines
|
||||||
@@ -14,9 +16,9 @@ SKIP_TESTS=(
|
|||||||
[test_cmath.py]=1 # test assertion failure
|
[test_cmath.py]=1 # test assertion failure
|
||||||
[test_cmd_line.py]=1 # Interactive?
|
[test_cmd_line.py]=1 # Interactive?
|
||||||
[test_cmd_line_script.py]=1
|
[test_cmd_line_script.py]=1
|
||||||
|
[test_codecs.py]=1
|
||||||
[test_collections.py]=1
|
[test_collections.py]=1
|
||||||
[test_compare.py]=1
|
[test_compare.py]=1
|
||||||
[test_compileall.py]=1 # fails on its own
|
|
||||||
[test_compile.py]=1
|
[test_compile.py]=1
|
||||||
[test_concurrent_futures.py]=1 # too long
|
[test_concurrent_futures.py]=1 # too long
|
||||||
[test_configparser.py]=1
|
[test_configparser.py]=1
|
||||||
|
@@ -136,25 +136,25 @@ PASS = SyntaxTree('stmts',
|
|||||||
[ SyntaxTree('pass', [])])])])
|
[ SyntaxTree('pass', [])])])])
|
||||||
|
|
||||||
ASSIGN_DOC_STRING = lambda doc_string, doc_load: \
|
ASSIGN_DOC_STRING = lambda doc_string, doc_load: \
|
||||||
SyntaxTree('stmt',
|
SyntaxTree("stmt",
|
||||||
[ SyntaxTree('assign',
|
[ SyntaxTree("assign",
|
||||||
[ SyntaxTree('expr', [ Token(doc_load, pattr=doc_string, attr=doc_string) ]),
|
[ SyntaxTree("expr", [ Token(doc_load, pattr=doc_string, attr=doc_string) ]),
|
||||||
SyntaxTree('store', [ Token('STORE_NAME', pattr='__doc__')])
|
SyntaxTree("store", [ Token("STORE_NAME", pattr="__doc__")])
|
||||||
])])
|
])])
|
||||||
|
|
||||||
NAME_MODULE = SyntaxTree('stmt',
|
NAME_MODULE = SyntaxTree("sstmt",
|
||||||
[ SyntaxTree('assign',
|
[ SyntaxTree("assign",
|
||||||
[ SyntaxTree('expr',
|
[ SyntaxTree("expr",
|
||||||
[Token('LOAD_NAME', pattr='__name__', offset=0, has_arg=True)]),
|
[Token("LOAD_NAME", pattr="__name__", offset=0, has_arg=True)]),
|
||||||
SyntaxTree('store',
|
SyntaxTree("store",
|
||||||
[ Token('STORE_NAME', pattr='__module__', offset=3, has_arg=True)])
|
[ Token("STORE_NAME", pattr="__module__", offset=3, has_arg=True)])
|
||||||
])])
|
])])
|
||||||
|
|
||||||
# God intended \t, but Python has decided to use 4 spaces.
|
# God intended \t, but Python has decided to use 4 spaces.
|
||||||
# If you want real tabs, use Go.
|
# If you want real tabs, use Go.
|
||||||
# TAB = '\t'
|
# TAB = "\t"
|
||||||
TAB = ' ' * 4
|
TAB = " " * 4
|
||||||
INDENT_PER_LEVEL = ' ' # additional intent per pretty-print level
|
INDENT_PER_LEVEL = " " # additional intent per pretty-print level
|
||||||
|
|
||||||
TABLE_R = {
|
TABLE_R = {
|
||||||
'STORE_ATTR': ( '%c.%[1]{pattr}', 0),
|
'STORE_ATTR': ( '%c.%[1]{pattr}', 0),
|
||||||
|
@@ -2271,13 +2271,13 @@ class SourceWalker(GenericASTTraversal, object):
|
|||||||
self.println(self.traverse(ast[0]))
|
self.println(self.traverse(ast[0]))
|
||||||
del ast[0]
|
del ast[0]
|
||||||
|
|
||||||
first_stmt = ast[0][0]
|
first_stmt = ast[0]
|
||||||
if 3.0 <= self.version <= 3.3:
|
if 3.0 <= self.version <= 3.3:
|
||||||
try:
|
try:
|
||||||
if first_stmt[0] == "store_locals":
|
if first_stmt == "store_locals":
|
||||||
if self.hide_internal:
|
if self.hide_internal:
|
||||||
del ast[0]
|
del ast[0]
|
||||||
first_stmt = ast[0][0]
|
first_stmt = ast[0]
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -2285,7 +2285,7 @@ class SourceWalker(GenericASTTraversal, object):
|
|||||||
if first_stmt == NAME_MODULE:
|
if first_stmt == NAME_MODULE:
|
||||||
if self.hide_internal:
|
if self.hide_internal:
|
||||||
del ast[0]
|
del ast[0]
|
||||||
first_stmt = ast[0][0]
|
first_stmt = ast[0]
|
||||||
pass
|
pass
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
@@ -2295,17 +2295,12 @@ class SourceWalker(GenericASTTraversal, object):
|
|||||||
# Should we ditch this in favor of the "else" case?
|
# Should we ditch this in favor of the "else" case?
|
||||||
qualname = ".".join(self.classes)
|
qualname = ".".join(self.classes)
|
||||||
QUAL_NAME = SyntaxTree(
|
QUAL_NAME = SyntaxTree(
|
||||||
"stmt",
|
"assign",
|
||||||
[
|
[
|
||||||
|
SyntaxTree("expr", [Token("LOAD_CONST", pattr=qualname)]),
|
||||||
SyntaxTree(
|
SyntaxTree(
|
||||||
"assign",
|
"store", [Token("STORE_NAME", pattr="__qualname__")]
|
||||||
[
|
),
|
||||||
SyntaxTree("expr", [Token("LOAD_CONST", pattr=qualname)]),
|
|
||||||
SyntaxTree(
|
|
||||||
"store", [Token("STORE_NAME", pattr="__qualname__")]
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
have_qualname = ast[0][0] == QUAL_NAME
|
have_qualname = ast[0][0] == QUAL_NAME
|
||||||
|
Reference in New Issue
Block a user