summaryrefslogtreecommitdiff
path: root/Include
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-09-21 12:48:10 -0700
committerGitHub <noreply@github.com>2018-09-21 12:48:10 -0700
commit187f2dd256a917c20bf55954d019fd35fb46ab08 (patch)
tree6e2758eb460673d3c34264f6472cff82006443a3 /Include
parent975f3cb1f25406a9be019906227d53b23852f415 (diff)
downloadcpython-git-187f2dd256a917c20bf55954d019fd35fb46ab08.tar.gz
bpo-34762: Fix contextvars C API to use PyObject* pointer types. (GH-9473)
(cherry picked from commit 2ec872b31e25cee1f983fe07991fb53f3fd1cbac) Co-authored-by: Yury Selivanov <yury@magic.io>
Diffstat (limited to 'Include')
-rw-r--r--Include/context.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/Include/context.h b/Include/context.h
index 8b9f1292d7..9581285247 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. */