You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
3.7+ multiple imports of dotted path
This commit is contained in:
@@ -243,7 +243,6 @@ case $PYVERSION in
|
|||||||
[test_dis.py]=1 # We change line numbers - duh!
|
[test_dis.py]=1 # We change line numbers - duh!
|
||||||
[test_enumerate.py]=1 #
|
[test_enumerate.py]=1 #
|
||||||
[test_enum.py]=1 #
|
[test_enum.py]=1 #
|
||||||
[test_exceptions.py]=1 # works in decompile3; dotted import errors - Investigate
|
|
||||||
[test_faulthandler.py]=1 # takes too long
|
[test_faulthandler.py]=1 # takes too long
|
||||||
# ...
|
# ...
|
||||||
)
|
)
|
||||||
@@ -251,8 +250,9 @@ case $PYVERSION in
|
|||||||
3.8)
|
3.8)
|
||||||
SKIP_TESTS=(
|
SKIP_TESTS=(
|
||||||
[test_contains.py]=1 # Code "while False: yield None" is optimized away in compilation
|
[test_contains.py]=1 # Code "while False: yield None" is optimized away in compilation
|
||||||
[test_collections.py]=1 # Fixed I think in decompyle3 - pull from there
|
[test_collections.py]=1 # Investigate
|
||||||
[test_decorators.py]=1 # Control flow wrt "if elif"
|
[test_decorators.py]=1 # Control flow wrt "if elif"
|
||||||
|
[test_exceptions.py]=1 # parse error
|
||||||
[test_dis.py]=1 # We change line numbers - duh!
|
[test_dis.py]=1 # We change line numbers - duh!
|
||||||
[test_pow.py]=1 # Control flow wrt "continue"
|
[test_pow.py]=1 # Control flow wrt "continue"
|
||||||
[test_quopri.py]=1 # Only fails on POWER
|
[test_quopri.py]=1 # Only fails on POWER
|
||||||
|
@@ -62,6 +62,8 @@ class PythonParser(GenericASTBuilder):
|
|||||||
'kvlist_n',
|
'kvlist_n',
|
||||||
# Python 3.6+
|
# Python 3.6+
|
||||||
'come_from_loops',
|
'come_from_loops',
|
||||||
|
# Python 3.7+
|
||||||
|
'importlist37',
|
||||||
]
|
]
|
||||||
self.collect = frozenset(nt_list)
|
self.collect = frozenset(nt_list)
|
||||||
|
|
||||||
|
@@ -346,7 +346,7 @@ class Python37Parser(Python37BaseParser):
|
|||||||
attribute37 ::= expr LOAD_METHOD
|
attribute37 ::= expr LOAD_METHOD
|
||||||
|
|
||||||
stmt ::= import_from37
|
stmt ::= import_from37
|
||||||
importlist37 ::= importlist37 alias
|
importlist37 ::= importlist37 alias37
|
||||||
importlist37 ::= alias37
|
importlist37 ::= alias37
|
||||||
alias37 ::= IMPORT_NAME store
|
alias37 ::= IMPORT_NAME store
|
||||||
alias37 ::= IMPORT_FROM store
|
alias37 ::= IMPORT_FROM store
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
"""Isolate Python 3.7 version-specific semantic actions here.
|
"""Isolate Python 3.7 version-specific semantic actions here.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from uncompyle6.semantics.consts import PRECEDENCE, TABLE_DIRECT
|
from uncompyle6.semantics.consts import PRECEDENCE, TABLE_DIRECT, maxint
|
||||||
|
|
||||||
def customize_for_version37(self, version):
|
def customize_for_version37(self, version):
|
||||||
########################
|
########################
|
||||||
@@ -135,6 +135,7 @@ def customize_for_version37(self, version):
|
|||||||
(3, 'importlist37') ),
|
(3, 'importlist37') ),
|
||||||
|
|
||||||
"importattr37": ("%c", (0, "IMPORT_NAME_ATTR")),
|
"importattr37": ("%c", (0, "IMPORT_NAME_ATTR")),
|
||||||
|
'importlist37': ("%C", (0, maxint, ', ') ),
|
||||||
'list_if37': ( " if %p%c", (0, 27), 1 ),
|
'list_if37': ( " if %p%c", (0, 27), 1 ),
|
||||||
'list_if37_not': ( " if not %p%c", (0, 27), 1 ),
|
'list_if37_not': ( " if not %p%c", (0, 27), 1 ),
|
||||||
"testfalse_not_or": ("not %c or %c", (0, "expr"), (2, "expr")),
|
"testfalse_not_or": ("not %c or %c", (0, "expr"), (2, "expr")),
|
||||||
|
Reference in New Issue
Block a user