From eed632a1321cbf741989af8cec110a957e7463d0 Mon Sep 17 00:00:00 2001 From: Lisandro Dalcin Date: Sun, 25 Oct 2009 17:28:03 -0200 Subject: [PATCH] add missing slots 'tp_del' (Py>=2.3) and 'tp_version_tag' (Py>=2.6) --- Cython/Compiler/TypeSlots.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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"), ) #------------------------------------------------------------------------------------------ -- 2.26.2