From: Lisandro Dalcin Date: Sun, 25 Oct 2009 19:28:03 +0000 (-0200) Subject: add missing slots 'tp_del' (Py>=2.3) and 'tp_version_tag' (Py>=2.6) X-Git-Tag: 0.12.alpha0~21 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=eed632a1321cbf741989af8cec110a957e7463d0;p=cython.git add missing slots 'tp_del' (Py>=2.3) and 'tp_version_tag' (Py>=2.6) --- diff --git a/Cython/Compiler/TypeSlots.py b/Cython/Compiler/TypeSlots.py index a6008a3b..d23559a6 100644 --- a/Cython/Compiler/TypeSlots.py +++ b/Cython/Compiler/TypeSlots.py @@ -187,8 +187,8 @@ class FixedSlot(SlotDescriptor): # # value string - def __init__(self, slot_name, value, py3k=True): - SlotDescriptor.__init__(self, slot_name, py3k=py3k) + def __init__(self, slot_name, value, py3k=True, py2=True, ifdef=None): + SlotDescriptor.__init__(self, slot_name, py3k=py3k, py2=py2, ifdef=ifdef) self.value = value def slot_code(self, scope): @@ -198,8 +198,8 @@ class FixedSlot(SlotDescriptor): class EmptySlot(FixedSlot): # Descriptor for a type slot whose value is always 0. - def __init__(self, slot_name, py3k=True): - FixedSlot.__init__(self, slot_name, "0", py3k=py3k) + def __init__(self, slot_name, py3k=True, py2=True, ifdef=None): + FixedSlot.__init__(self, slot_name, "0", py3k=py3k, py2=py2, ifdef=ifdef) class MethodSlot(SlotDescriptor): @@ -692,6 +692,8 @@ slot_table = ( EmptySlot("tp_cache"), EmptySlot("tp_subclasses"), EmptySlot("tp_weaklist"), + EmptySlot("tp_del"), + EmptySlot("tp_version_tag", ifdef="PY_VERSION_HEX >= 0x02060000"), ) #------------------------------------------------------------------------------------------