You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Start to handle 3.7
This commit is contained in:
BIN
test/bytecode_3.7/00_import.pyc
Normal file
BIN
test/bytecode_3.7/00_import.pyc
Normal file
Binary file not shown.
@@ -71,10 +71,9 @@ def main_bin():
|
|||||||
if not (sys.version_info[0:2] in ((2, 6), (2, 7),
|
if not (sys.version_info[0:2] in ((2, 6), (2, 7),
|
||||||
(3, 1), (3, 2), (3, 3),
|
(3, 1), (3, 2), (3, 3),
|
||||||
(3, 4), (3, 5), (3, 6),
|
(3, 4), (3, 5), (3, 6),
|
||||||
# (3, 7)
|
(3, 7)
|
||||||
)):
|
)):
|
||||||
# print('Error: %s requires Python 2.6-2.7, or 3.1-3.7' % program,
|
print('Error: %s requires Python 2.6-2.7, or 3.1-3.7' % program,
|
||||||
print('Error: %s requires Python 2.6-2.7, or 3.1-3.6' % program,
|
|
||||||
file=sys.stderr)
|
file=sys.stderr)
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
|
@@ -721,6 +721,12 @@ def get_python_parser(
|
|||||||
p = parse36.Python36Parser(debug_parser)
|
p = parse36.Python36Parser(debug_parser)
|
||||||
else:
|
else:
|
||||||
p = parse36.Python36ParserSingle(debug_parser)
|
p = parse36.Python36ParserSingle(debug_parser)
|
||||||
|
elif version == 3.7:
|
||||||
|
import uncompyle6.parsers.parse37 as parse37
|
||||||
|
if compile_mode == 'exec':
|
||||||
|
p = parse37.Python37Parser(debug_parser)
|
||||||
|
else:
|
||||||
|
p = parse37.Python37ParserSingle(debug_parser)
|
||||||
else:
|
else:
|
||||||
if compile_mode == 'exec':
|
if compile_mode == 'exec':
|
||||||
p = parse3.Python3Parser(debug_parser)
|
p = parse3.Python3Parser(debug_parser)
|
||||||
|
@@ -27,6 +27,15 @@ class Python37Parser(Python36Parser):
|
|||||||
super(Python37Parser, self).__init__(debug_parser)
|
super(Python37Parser, self).__init__(debug_parser)
|
||||||
self.customized = {}
|
self.customized = {}
|
||||||
|
|
||||||
|
def p_37misc(self, args):
|
||||||
|
"""
|
||||||
|
# Where does the POP_TOP really belong?
|
||||||
|
stmt ::= import37
|
||||||
|
import37 ::= import POP_TOP
|
||||||
|
|
||||||
|
# Is there a pattern here?
|
||||||
|
attributes ::= IMPORT_FROM ROT_TWO POP_TOP IMPORT_FROM
|
||||||
|
"""
|
||||||
|
|
||||||
class Python37ParserSingle(Python37Parser, PythonParserSingle):
|
class Python37ParserSingle(Python37Parser, PythonParserSingle):
|
||||||
pass
|
pass
|
||||||
|
Reference in New Issue
Block a user