Skip to content

Commit 375bf2c

Browse files
Revert for ctypes
1 parent d3b0e31 commit 375bf2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/_ctypes/_ctypes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ CDataType_from_buffer_copy_impl(PyObject *type, PyTypeObject *cls,
987987

988988
result = generic_pycdata_new(st, (PyTypeObject *)type, NULL, NULL);
989989
if (result != NULL) {
990-
assert(Py_REFCNT(result) == 1);
990+
assert(_PyObject_IsUniquelyReferenced(result));
991991
memcpy(((CDataObject *) result)->b_ptr, (char *)buffer->buf + offset, info->size);
992992
}
993993
return result;
@@ -3251,7 +3251,7 @@ PyCData_MallocBuffer(CDataObject *obj, StgInfo *info)
32513251
* used in constructors and therefore does not have concurrent
32523252
* access.
32533253
*/
3254-
assert (_PyObject_IsUniquelyReferenced((PyObject *)obj));
3254+
assert (Py_REFCNT(obj) == 1);
32553255
assert(stginfo_get_dict_final(info) == 1);
32563256

32573257
if ((size_t)info->size <= sizeof(obj->b_value)) {

0 commit comments

Comments
 (0)