Commit 1cc58b51 authored by Stefan Behnel's avatar Stefan Behnel

Provide a fallback implementation for PyContextVar_Get() that always returns...

Provide a fallback implementation for PyContextVar_Get() that always returns the default value on Py<3.7.
This is currently needed to make the inline functions compile, because it seems that we are not properly excluding unused ones.
parent ff16389c
......@@ -2,6 +2,14 @@ from cpython.object cimport PyObject
from cpython.ref cimport Py_XDECREF
cdef extern from "Python.h":
# Defining PyContextVar_Get() below to always return the default value for Py<3.7
# to make the inline functions sort-of work.
"""
#if PY_VERSION_HEX < 0x030700b1 && !defined(PyContextVar_Get)
#define PyContextVar_Get(var, d, v) \
((void)(var), (d) ? Py_INCREF(d) : NULL, (v)[0] = (d), 0)
#endif
"""
############################################################################
# Context Variables Objects
......
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