aports/community/zbar/py3.11.patch
2022-11-23 03:26:57 +01:00

23 lines
866 B
Diff

diff --git a/python/enum.c b/python/enum.c
index dfe1b1e..2084739 100644
--- a/python/enum.c
+++ b/python/enum.c
@@ -52,7 +52,7 @@ enumitem_new (PyTypeObject *type,
/* we assume the "fast path" for a single-digit ints (see longobject.c) */
/* this also holds if we get a small_int preallocated long */
- Py_SIZE(&self->val) = Py_SIZE(longval);
+ Py_SET_SIZE(&self->val, Py_SIZE(longval));
self->val.ob_digit[0] = longval->ob_digit[0];
Py_DECREF(longval);
#else
@@ -143,7 +143,7 @@ zbarEnumItem_New (PyObject *byname,
/* we assume the "fast path" for a single-digit ints (see longobject.c) */
/* this also holds if we get a small_int preallocated long */
- Py_SIZE(&self->val) = Py_SIZE(longval);
+ Py_SET_SIZE(&self->val, Py_SIZE(longval));
self->val.ob_digit[0] = longval->ob_digit[0];
Py_DECREF(longval);