Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
5fb94a34
Commit
5fb94a34
authored
Sep 01, 2014
by
Lisandro Dalcin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove conditional compilation handling old Python < 2.6
parent
4a1da9bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
12 deletions
+7
-12
Cython/Compiler/TypeSlots.py
Cython/Compiler/TypeSlots.py
+3
-3
Cython/Includes/cpython/version.pxd
Cython/Includes/cpython/version.pxd
+2
-2
tests/run/ext_attribute_cache.pyx
tests/run/ext_attribute_cache.pyx
+2
-7
No files found.
Cython/Compiler/TypeSlots.py
View file @
5fb94a34
...
@@ -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"
),
)
)
...
...
Cython/Includes/cpython/version.pxd
View file @
5fb94a34
...
@@ -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 >= 0x020
6
0000:
# if PY_VERSION_HEX >= 0x020
7
0000:
# 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.
...
...
tests/run/ext_attribute_cache.pyx
View file @
5fb94a34
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment