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
Kirill Smelkov
cython
Commits
c1dc048b
Commit
c1dc048b
authored
May 14, 2021
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix conditional code in __Pyx_PyType_Ready() for Py3.10.
parent
18fc9f76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
Cython/Utility/ExtensionTypes.c
Cython/Utility/ExtensionTypes.c
+8
-7
No files found.
Cython/Utility/ExtensionTypes.c
View file @
c1dc048b
...
...
@@ -73,12 +73,12 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) {
// Make sure GC does not pick up our non-heap type as heap type with this hack!
// For details, see https://github.com/cython/cython/issues/3603
int
gc_was_enabled
;
#if PY_VERSION_HEX >= 0x030A00b1
#if PY_VERSION_HEX >= 0x030A00b1
// finally added in Py3.10 :)
gc_was_enabled
=
PyGC_Disable
();
(
void
)
__Pyx_PyObject_CallMethod0
;
#else
#else
// Call gc.disable() as a backwards compatible fallback, but only if needed.
PyObject
*
ret
,
*
py_status
;
PyObject
*
gc
=
NULL
;
...
...
@@ -106,7 +106,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) {
Py_DECREF
(
gc
);
return
-
1
;
}
#endif
#endif
// As of https://bugs.python.org/issue22079
// PyType_Ready enforces that all bases of a non-heap type are
...
...
@@ -126,10 +126,11 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if PY_VERSION_HEX >= 0x03050000
t
->
tp_flags
&=
~
Py_TPFLAGS_HEAPTYPE
;
if
(
gc_was_enabled
)
{
#if PY_VERSION_HEX >= 0x030A00b1
#if PY_VERSION_HEX >= 0x030A00b1
if
(
gc_was_enabled
)
PyGC_Enable
();
#else
#else
if
(
gc_was_enabled
)
{
PyObject
*
t
,
*
v
,
*
tb
;
PyErr_Fetch
(
&
t
,
&
v
,
&
tb
);
ret
=
__Pyx_PyObject_CallMethod0
(
gc
,
PYUNICODE
(
"enable"
));
...
...
@@ -146,7 +147,7 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) {
}
}
Py_DECREF
(
gc
);
#endif
#endif
}
#endif
...
...
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