Skip to content

Commit 968dcd9

Browse files
authored
bpo-39573: Fix bad copy-paste in Py_SET_SIZE (GH-18496)
1 parent 925dc7f commit 968dcd9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Doc/c-api/structures.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ the definition of all other Python objects.
103103
104104
.. c:function:: void Py_SET_SIZE(PyVarObject *o, Py_ssize_t size)
105105
106-
Set the object *o* size of *size*.
106+
Set the object *o* size to *size*.
107107
108108
.. versionadded:: 3.9
109109

Include/object.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ static inline void _Py_SET_TYPE(PyObject *ob, PyTypeObject *type) {
133133
}
134134
#define Py_SET_TYPE(ob, type) _Py_SET_TYPE(_PyObject_CAST(ob), type)
135135

136-
static inline void _Py_SET_SIZE(PyVarObject *ob, Py_ssize_t refcnt) {
137-
ob->ob_size = refcnt;
136+
static inline void _Py_SET_SIZE(PyVarObject *ob, Py_ssize_t size) {
137+
ob->ob_size = size;
138138
}
139-
#define Py_SET_SIZE(ob, refcnt) _Py_SET_SIZE(_PyVarObject_CAST(ob), refcnt)
139+
#define Py_SET_SIZE(ob, size) _Py_SET_SIZE(_PyVarObject_CAST(ob), size)
140140

141141

142142
/*

0 commit comments

Comments
 (0)