Skip to content

Commit 853490a

Browse files
Revert commits for _replace_array_elements
1 parent 60a02a3 commit 853490a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Modules/_ctypes/stgdict.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ PyCStructUnionType_update_stginfo(PyObject *type, PyObject *fields, int isStruct
230230
// They're cleared on error.
231231
PyObject *layout_func = NULL;
232232
PyObject *kwnames = NULL;
233-
PyObject *align_obj = NULL;
234-
PyObject *size_obj = NULL;
233+
PyObject* align = NULL;
234+
PyObject* size = NULL;
235235
PyObject *layout_fields_obj = NULL;
236236
PyObject *layout_fields = NULL;
237237
PyObject *layout = NULL;
@@ -296,12 +296,12 @@ PyCStructUnionType_update_stginfo(PyObject *type, PyObject *fields, int isStruct
296296
goto error;
297297
}
298298

299-
align_obj = PyObject_GetAttr(layout, &_Py_ID(align));
300-
if (!align_obj) {
299+
align = PyObject_GetAttr(layout, &_Py_ID(align));
300+
if (!align) {
301301
goto error;
302302
}
303-
Py_ssize_t total_align = PyLong_AsSsize_t(align_obj);
304-
Py_CLEAR(align_obj);
303+
Py_ssize_t total_align = PyLong_AsSsize_t(align);
304+
Py_CLEAR(align);
305305
if (total_align < 0) {
306306
if (!PyErr_Occurred()) {
307307
PyErr_SetString(PyExc_ValueError,
@@ -310,12 +310,12 @@ PyCStructUnionType_update_stginfo(PyObject *type, PyObject *fields, int isStruct
310310
goto error;
311311
}
312312

313-
size_obj = PyObject_GetAttr(layout, &_Py_ID(size));
314-
if (!size_obj) {
313+
size = PyObject_GetAttr(layout, &_Py_ID(size));
314+
if (!size) {
315315
goto error;
316316
}
317-
Py_ssize_t total_size = PyLong_AsSsize_t(size_obj);
318-
Py_CLEAR(size_obj);
317+
Py_ssize_t total_size = PyLong_AsSsize_t(size);
318+
Py_CLEAR(size);
319319
if (total_size < 0) {
320320
if (!PyErr_Occurred()) {
321321
PyErr_SetString(PyExc_ValueError,
@@ -468,8 +468,8 @@ PyCStructUnionType_update_stginfo(PyObject *type, PyObject *fields, int isStruct
468468
error:
469469
Py_XDECREF(layout_func);
470470
Py_XDECREF(kwnames);
471-
Py_XDECREF(align_obj);
472-
Py_XDECREF(size_obj);
471+
Py_XDECREF(align);
472+
Py_XDECREF(size);
473473
Py_XDECREF(layout_fields_obj);
474474
Py_XDECREF(layout_fields);
475475
Py_XDECREF(layout);

0 commit comments

Comments
 (0)