summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLisandro Dalcin <dalcinl@gmail.com>2014-09-01 12:04:52 +0300
committerLisandro Dalcin <dalcinl@gmail.com>2014-09-01 12:04:52 +0300
commit5fb94a341dd45f87dd5d00249c506150992d431e (patch)
tree2e1816fe2ec69a639fe81d3e4927d822241ac39c
parent4a1da9bf171f25ce27b9630506026344d07340ab (diff)
downloadcython-dalcinl/no-old-python.tar.gz
Remove conditional compilation handling old Python < 2.6dalcinl/no-old-python
-rw-r--r--Cython/Compiler/TypeSlots.py6
-rw-r--r--Cython/Includes/cpython/version.pxd4
-rw-r--r--tests/run/ext_attribute_cache.pyx9
3 files changed, 7 insertions, 12 deletions
diff --git a/Cython/Compiler/TypeSlots.py b/Cython/Compiler/TypeSlots.py
index 3a66cc259..f9eb6bb1c 100644
--- a/Cython/Compiler/TypeSlots.py
+++ b/Cython/Compiler/TypeSlots.py
@@ -738,8 +738,8 @@ PyBufferProcs = (
MethodSlot(segcountproc, "bf_getsegcount", "__getsegcount__", py3 = False),
MethodSlot(charbufferproc, "bf_getcharbuffer", "__getcharbuffer__", py3 = False),
- MethodSlot(getbufferproc, "bf_getbuffer", "__getbuffer__", ifdef = "PY_VERSION_HEX >= 0x02060000"),
- MethodSlot(releasebufferproc, "bf_releasebuffer", "__releasebuffer__", ifdef = "PY_VERSION_HEX >= 0x02060000")
+ MethodSlot(getbufferproc, "bf_getbuffer", "__getbuffer__"),
+ MethodSlot(releasebufferproc, "bf_releasebuffer", "__releasebuffer__")
)
#------------------------------------------------------------------------------------------
@@ -809,7 +809,7 @@ slot_table = (
EmptySlot("tp_subclasses"),
EmptySlot("tp_weaklist"),
EmptySlot("tp_del"),
- EmptySlot("tp_version_tag", ifdef="PY_VERSION_HEX >= 0x02060000"),
+ EmptySlot("tp_version_tag"),
EmptySlot("tp_finalize", ifdef="PY_VERSION_HEX >= 0x030400a1"),
)
diff --git a/Cython/Includes/cpython/version.pxd b/Cython/Includes/cpython/version.pxd
index 83c6817c0..ce31b249c 100644
--- a/Cython/Includes/cpython/version.pxd
+++ b/Cython/Includes/cpython/version.pxd
@@ -4,8 +4,8 @@
#
# if PY_MAJOR_VERSION >= 3:
# do_stuff_in_Py3_0_and_later()
-# if PY_VERSION_HEX >= 0x02060000:
-# do_stuff_in_Py2_6_and_later()
+# if PY_VERSION_HEX >= 0x02070000:
+# do_stuff_in_Py2_7_and_later()
#
# than using the IF/DEF statements, which are evaluated at Cython
# compile time. This will keep your C code portable.
diff --git a/tests/run/ext_attribute_cache.pyx b/tests/run/ext_attribute_cache.pyx
index 7901bfae9..dd50dc1c0 100644
--- a/tests/run/ext_attribute_cache.pyx
+++ b/tests/run/ext_attribute_cache.pyx
@@ -11,9 +11,6 @@ cdef extern from *:
unsigned long tp_flags
-SHOULD_HAVE_FLAG = PY_VERSION_HEX >= 0x02060000
-
-
def test_flag(t):
return ((<PyTypeObject*>t).tp_flags & Py_TPFLAGS_HAVE_VERSION_TAG) != 0
@@ -21,8 +18,7 @@ def test_flag(t):
cdef class ImplicitAttrCache(object):
"""
>>> flag = test_flag(ImplicitAttrCache)
- >>> if SHOULD_HAVE_FLAG: print(flag)
- ... else: print(True)
+ >>> print(flag)
True
"""
cdef public int x
@@ -33,8 +29,7 @@ cdef class ImplicitAttrCache(object):
cdef class ExplicitAttrCache(object):
"""
>>> flag = test_flag(ImplicitAttrCache)
- >>> if SHOULD_HAVE_FLAG: print(flag)
- ... else: print(True)
+ >>> print(flag)
True
"""
cdef public int x