summaryrefslogtreecommitdiffstats
path: root/Include/boolobject.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-11-05 14:02:12 (GMT)
committerGitHub <noreply@github.com>2020-11-05 14:02:12 (GMT)
commit53a03aafd5812018a3821a2e83063fd3d6cd2576 (patch)
treec38adba5e60f412a36ea31736fb6265b2f754a40 /Include/boolobject.h
parent80449f243b13311d660eab3a751648029bcdd833 (diff)
downloadcpython-53a03aafd5812018a3821a2e83063fd3d6cd2576.zip
cpython-53a03aafd5812018a3821a2e83063fd3d6cd2576.tar.gz
cpython-53a03aafd5812018a3821a2e83063fd3d6cd2576.tar.bz2
bpo-42262: Add Py_NewRef() and Py_XNewRef() (GH-23152)
Added Py_NewRef() and Py_XNewRef() functions to increment the reference count of an object and return the object.
Diffstat (limited to 'Include/boolobject.h')
-rw-r--r--Include/boolobject.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Include/boolobject.h b/Include/boolobject.h
index bb8044a..6673d72 100644
--- a/Include/boolobject.h
+++ b/Include/boolobject.h
@@ -22,8 +22,8 @@ PyAPI_DATA(struct _longobject) _Py_FalseStruct, _Py_TrueStruct;
#define Py_True ((PyObject *) &_Py_TrueStruct)
/* Macros for returning Py_True or Py_False, respectively */
-#define Py_RETURN_TRUE return Py_INCREF(Py_True), Py_True
-#define Py_RETURN_FALSE return Py_INCREF(Py_False), Py_False
+#define Py_RETURN_TRUE return Py_NewRef(Py_True)
+#define Py_RETURN_FALSE return Py_NewRef(Py_False)
/* Function to return a bool from a C long */
PyAPI_FUNC(PyObject *) PyBool_FromLong(long);