Fix up Python 3.0 handling

This commit is contained in:
rocky
2017-01-22 03:45:40 -05:00
parent 476a1c8ab5
commit cc2321f49e
2 changed files with 12 additions and 8 deletions

View File

@@ -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

View File

@@ -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