You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Python 3 genexpr bug
This commit is contained in:
BIN
test/bytecode_3.5/08_genexpr.pyc
Normal file
BIN
test/bytecode_3.5/08_genexpr.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_3.5/10_genexpr.pyc
Normal file
BIN
test/bytecode_3.5/10_genexpr.pyc
Normal file
Binary file not shown.
10
test/simple_source/expression/08_genexpr.py
Normal file
10
test/simple_source/expression/08_genexpr.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# Bug in Python 3.5.1 calendar.py
|
||||
|
||||
# expr ::= LOAD_NAME
|
||||
# get_iter ::= expr GET_ITER
|
||||
# expr ::= get_iter
|
||||
# genexpr ::= LOAD_GENEXPR LOAD_CONST MAKE_FUNCTION_0 expr GET_ITER CALL_FUNCTION_1
|
||||
# expr ::= genexpr
|
||||
|
||||
names = (formatmonthname(False)
|
||||
for k in __file__)
|
11
test/simple_source/expression/10_genexpr.py
Normal file
11
test/simple_source/expression/10_genexpr.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# From Python 3.4 calendar
|
||||
|
||||
# load_closure ::= LOAD_CLOSURE
|
||||
# load_closure ::= load_closure LOAD_CLOSURE
|
||||
# expr ::= LOAD_GLOBAL
|
||||
# get_iter ::= expr GET_ITER
|
||||
# genexpr ::= load_closure LOAD_GENEXPR LOAD_CONST MAKE_CLOSURE_0 expr GET_ITER CALL_FUNCTION_
|
||||
def formatyear(self, theyear, m=3):
|
||||
for (i, row) in enumerate(self.yeardays2calendar(theyear, m)):
|
||||
names = (self.formatmonthname(theyear, k, colwidth, False)
|
||||
for k in months)
|
@@ -358,11 +358,10 @@ class Python3Parser(PythonParser):
|
||||
'''
|
||||
load_genexpr ::= LOAD_GENEXPR
|
||||
load_genexpr ::= BUILD_TUPLE_1 LOAD_GENEXPR LOAD_CONST
|
||||
'''
|
||||
|
||||
def p_genexpr2(self, args):
|
||||
'''
|
||||
# Is there something general going on here?
|
||||
genexpr ::= LOAD_GENEXPR LOAD_CONST MAKE_FUNCTION_0 expr GET_ITER CALL_FUNCTION_1
|
||||
genexpr ::= load_closure LOAD_GENEXPR LOAD_CONST MAKE_CLOSURE_0 expr GET_ITER CALL_FUNCTION_1
|
||||
'''
|
||||
|
||||
def p_expr3(self, args):
|
||||
|
Reference in New Issue
Block a user