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.x class bug using subclass fns
This commit is contained in:
BIN
test/bytecode_3.4/07_classderef.pyc-notyet
Normal file
BIN
test/bytecode_3.4/07_classderef.pyc-notyet
Normal file
Binary file not shown.
BIN
test/bytecode_3.4/11_classbug_subclass_fn.pyc
Normal file
BIN
test/bytecode_3.4/11_classbug_subclass_fn.pyc
Normal file
Binary file not shown.
7
test/simple_source/def/07_classderef.py
Normal file
7
test/simple_source/def/07_classderef.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# From 3.4 ctypes/__init__.py
|
||||||
|
# For opcode LOAD_CLASSDEREF
|
||||||
|
|
||||||
|
def CFUNCTYPE(argtypes):
|
||||||
|
class CFunctionType(object):
|
||||||
|
_argtypes_ = argtypes
|
||||||
|
return CFunctionType
|
5
test/simple_source/def/11_classbug_subclass_fn.py
Normal file
5
test/simple_source/def/11_classbug_subclass_fn.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# From python 3.4 endian.py
|
||||||
|
# Bug was having two CALL_FUNCTION ops in bytecode.
|
||||||
|
from ctypes import *
|
||||||
|
class _swapped_meta(type(Structure)):
|
||||||
|
pass
|
@@ -400,9 +400,11 @@ class Python3Parser(PythonParser):
|
|||||||
call_function))
|
call_function))
|
||||||
self.add_unique_rule(rule, opname, token.attr, customize)
|
self.add_unique_rule(rule, opname, token.attr, customize)
|
||||||
|
|
||||||
# Can the above build_class rule be folded into this rule?
|
# FIXME: What's the deal with the two rules? Different Python versions?
|
||||||
|
# Different situations? Note that the above rule is based on the CALL_FUNCTION
|
||||||
|
# token found, while this one doesn't.
|
||||||
rule = ("build_class ::= LOAD_BUILD_CLASS mkfunc expr call_function "
|
rule = ("build_class ::= LOAD_BUILD_CLASS mkfunc expr call_function "
|
||||||
"CALL_FUNCTION_" + str(args_pos+1))
|
"CALL_FUNCTION_3")
|
||||||
self.add_unique_rule(rule, opname, token.attr, customize)
|
self.add_unique_rule(rule, opname, token.attr, customize)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user