You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-02 16:44:46 +08:00
Fix up Python 3.0 handling
This commit is contained in:
@@ -5,9 +5,9 @@ spark grammar differences over Python 3.1 for Python 3.0.
|
||||
from __future__ import print_function
|
||||
|
||||
from uncompyle6.parser import PythonParserSingle
|
||||
from uncompyle6.parsers.parse3 import Python3Parser
|
||||
from uncompyle6.parsers.parse31 import Python31Parser
|
||||
|
||||
class Python30Parser(Python3Parser):
|
||||
class Python30Parser(Python31Parser):
|
||||
|
||||
def p_30(self, args):
|
||||
"""
|
||||
@@ -44,5 +44,10 @@ class Python30Parser(Python3Parser):
|
||||
setup_finally ::= STORE_FAST SETUP_FINALLY LOAD_FAST DELETE_FAST
|
||||
"""
|
||||
|
||||
def add_custom_rules(self, tokens, customize):
|
||||
super(Python30Parser, self).add_custom_rules(tokens, customize)
|
||||
return
|
||||
pass
|
||||
|
||||
class Python30ParserSingle(Python30Parser, PythonParserSingle):
|
||||
pass
|
||||
|
@@ -201,13 +201,12 @@ def cmp_code_objects(version, is_pypy, code_obj1, code_obj2,
|
||||
else:
|
||||
import uncompyle6.scanners.scanner27 as scan
|
||||
scanner = scan.Scanner27()
|
||||
elif version == 3.0:
|
||||
import uncompyle6.scanners.scanner30 as scan
|
||||
scanner = scan.Scanner30()
|
||||
elif version == 3.1:
|
||||
if is_pypy:
|
||||
import uncompyle6.scanners.pypy31 as scan
|
||||
scanner = scan.ScannerPyPy31()
|
||||
else:
|
||||
import uncompyle6.scanners.scanner32 as scan
|
||||
scanner = scan.Scanner32()
|
||||
import uncompyle6.scanners.scanner32 as scan
|
||||
scanner = scan.Scanner32()
|
||||
elif version == 3.2:
|
||||
if is_pypy:
|
||||
import uncompyle6.scanners.pypy32 as scan
|
||||
|
Reference in New Issue
Block a user