summaryrefslogtreecommitdiffstats
path: root/Include/context.h
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2018-09-21 19:33:56 (GMT)
committerGitHub <noreply@github.com>2018-09-21 19:33:56 (GMT)
commit2ec872b31e25cee1f983fe07991fb53f3fd1cbac (patch)
treeee3b5067dc9125be38d3a0ef0e5517a196f334aa /Include/context.h
parentb46ad5431d2643f61e929c1ffec48766b2fafd75 (diff)
downloadcpython-2ec872b31e25cee1f983fe07991fb53f3fd1cbac.zip
cpython-2ec872b31e25cee1f983fe07991fb53f3fd1cbac.tar.gz
cpython-2ec872b31e25cee1f983fe07991fb53f3fd1cbac.tar.bz2
bpo-34762: Fix contextvars C API to use PyObject* pointer types. (GH-9473)
Diffstat (limited to 'Include/context.h')
-rw-r--r--Include/context.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/Include/context.h b/Include/context.h
index 8b9f129..9581285 100644
--- a/Include/context.h
+++ b/Include/context.h
@@ -22,19 +22,19 @@ typedef struct _pycontexttokenobject PyContextToken;
#define PyContextToken_CheckExact(o) (Py_TYPE(o) == &PyContextToken_Type)
-PyAPI_FUNC(PyContext *) PyContext_New(void);
-PyAPI_FUNC(PyContext *) PyContext_Copy(PyContext *);
-PyAPI_FUNC(PyContext *) PyContext_CopyCurrent(void);
+PyAPI_FUNC(PyObject *) PyContext_New(void);
+PyAPI_FUNC(PyObject *) PyContext_Copy(PyObject *);
+PyAPI_FUNC(PyObject *) PyContext_CopyCurrent(void);
-PyAPI_FUNC(int) PyContext_Enter(PyContext *);
-PyAPI_FUNC(int) PyContext_Exit(PyContext *);
+PyAPI_FUNC(int) PyContext_Enter(PyObject *);
+PyAPI_FUNC(int) PyContext_Exit(PyObject *);
/* Create a new context variable.
default_value can be NULL.
*/
-PyAPI_FUNC(PyContextVar *) PyContextVar_New(
+PyAPI_FUNC(PyObject *) PyContextVar_New(
const char *name, PyObject *default_value);
@@ -54,21 +54,19 @@ PyAPI_FUNC(PyContextVar *) PyContextVar_New(
'*value' will be a new ref, if not NULL.
*/
PyAPI_FUNC(int) PyContextVar_Get(
- PyContextVar *var, PyObject *default_value, PyObject **value);
+ PyObject *var, PyObject *default_value, PyObject **value);
/* Set a new value for the variable.
Returns NULL if an error occurs.
*/
-PyAPI_FUNC(PyContextToken *) PyContextVar_Set(
- PyContextVar *var, PyObject *value);
+PyAPI_FUNC(PyObject *) PyContextVar_Set(PyObject *var, PyObject *value);
/* Reset a variable to its previous value.
Returns 0 on success, -1 on error.
*/
-PyAPI_FUNC(int) PyContextVar_Reset(
- PyContextVar *var, PyContextToken *token);
+PyAPI_FUNC(int) PyContextVar_Reset(PyObject *var, PyObject *token);
/* This method is exposed only for CPython tests. Don not use it. */