Commit 5fb94a34 authored by Lisandro Dalcin's avatar Lisandro Dalcin

Remove conditional compilation handling old Python < 2.6

parent 4a1da9bf
...@@ -738,8 +738,8 @@ PyBufferProcs = ( ...@@ -738,8 +738,8 @@ PyBufferProcs = (
MethodSlot(segcountproc, "bf_getsegcount", "__getsegcount__", py3 = False), MethodSlot(segcountproc, "bf_getsegcount", "__getsegcount__", py3 = False),
MethodSlot(charbufferproc, "bf_getcharbuffer", "__getcharbuffer__", py3 = False), MethodSlot(charbufferproc, "bf_getcharbuffer", "__getcharbuffer__", py3 = False),
MethodSlot(getbufferproc, "bf_getbuffer", "__getbuffer__", ifdef = "PY_VERSION_HEX >= 0x02060000"), MethodSlot(getbufferproc, "bf_getbuffer", "__getbuffer__"),
MethodSlot(releasebufferproc, "bf_releasebuffer", "__releasebuffer__", ifdef = "PY_VERSION_HEX >= 0x02060000") MethodSlot(releasebufferproc, "bf_releasebuffer", "__releasebuffer__")
) )
#------------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------------
...@@ -809,7 +809,7 @@ slot_table = ( ...@@ -809,7 +809,7 @@ slot_table = (
EmptySlot("tp_subclasses"), EmptySlot("tp_subclasses"),
EmptySlot("tp_weaklist"), EmptySlot("tp_weaklist"),
EmptySlot("tp_del"), EmptySlot("tp_del"),
EmptySlot("tp_version_tag", ifdef="PY_VERSION_HEX >= 0x02060000"), EmptySlot("tp_version_tag"),
EmptySlot("tp_finalize", ifdef="PY_VERSION_HEX >= 0x030400a1"), EmptySlot("tp_finalize", ifdef="PY_VERSION_HEX >= 0x030400a1"),
) )
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
# #
# if PY_MAJOR_VERSION >= 3: # if PY_MAJOR_VERSION >= 3:
# do_stuff_in_Py3_0_and_later() # do_stuff_in_Py3_0_and_later()
# if PY_VERSION_HEX >= 0x02060000: # if PY_VERSION_HEX >= 0x02070000:
# do_stuff_in_Py2_6_and_later() # do_stuff_in_Py2_7_and_later()
# #
# than using the IF/DEF statements, which are evaluated at Cython # than using the IF/DEF statements, which are evaluated at Cython
# compile time. This will keep your C code portable. # compile time. This will keep your C code portable.
......
...@@ -11,9 +11,6 @@ cdef extern from *: ...@@ -11,9 +11,6 @@ cdef extern from *:
unsigned long tp_flags unsigned long tp_flags
SHOULD_HAVE_FLAG = PY_VERSION_HEX >= 0x02060000
def test_flag(t): def test_flag(t):
return ((<PyTypeObject*>t).tp_flags & Py_TPFLAGS_HAVE_VERSION_TAG) != 0 return ((<PyTypeObject*>t).tp_flags & Py_TPFLAGS_HAVE_VERSION_TAG) != 0
...@@ -21,8 +18,7 @@ def test_flag(t): ...@@ -21,8 +18,7 @@ def test_flag(t):
cdef class ImplicitAttrCache(object): cdef class ImplicitAttrCache(object):
""" """
>>> flag = test_flag(ImplicitAttrCache) >>> flag = test_flag(ImplicitAttrCache)
>>> if SHOULD_HAVE_FLAG: print(flag) >>> print(flag)
... else: print(True)
True True
""" """
cdef public int x cdef public int x
...@@ -33,8 +29,7 @@ cdef class ImplicitAttrCache(object): ...@@ -33,8 +29,7 @@ cdef class ImplicitAttrCache(object):
cdef class ExplicitAttrCache(object): cdef class ExplicitAttrCache(object):
""" """
>>> flag = test_flag(ImplicitAttrCache) >>> flag = test_flag(ImplicitAttrCache)
>>> if SHOULD_HAVE_FLAG: print(flag) >>> print(flag)
... else: print(True)
True True
""" """
cdef public int x cdef public int x
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment