8000 Fix align and size naming in PyCStructUnionType_update_stginfo · python/cpython@f27c11a · GitHub
[go: up one dir, main page]

Skip to content

Commit f27c11a

Browse files
Fix align and size naming in PyCStructUnionType_update_stginfo
- as discussed in previous PR
1 parent 2038b58 commit f27c11a

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
@@ -225,8 +225,8 @@ PyCStructUnionType_update_stginfo(PyObject *type, PyObject *fields, int isStruct
225225
// They're cleared on error.
226226
PyObject *layout_func = NULL;
227227
PyObject *kwnames = NULL;
228-
PyObject* align = NULL;
229-
PyObject* size = NULL;
228+
PyObject *align_obj = NULL;
229+
PyObject *size_obj = NULL;
230230
PyObject *layout_fields_obj = NULL;
231231
PyObject *layout_fields = NULL;
232232
PyObject *layout = NULL;
@@ -291,12 +291,12 @@ PyCStructUnionType_update_stginfo(PyObject *type, PyObject *fields, int isStruct
291291
goto error;
292292
}
293293

294-
align = PyObject_GetAttr(layout, &_Py_ID(align));
295-
if (!align) {
294+
align_obj = PyObject_GetAttr(layout, &_Py_ID(align));
295+
if (!align_obj) {
296296
goto error;
297297
}
298-
Py_ssize_t total_align = PyLong_AsSsize_t(align);
299-
Py_CLEAR(align);
298+
Py_ssize_t total_align = PyLong_AsSsize_t(align_obj);
299+
Py_CLEAR(align_obj);
300300
if (total_align < 0) {
301301
if (!PyErr_Occurred()) {
302302
PyErr_SetString(PyExc_ValueError,
@@ -305,12 +305,12 @@ PyCStructUnionType_update_stginfo(PyObject *type, PyObject *fields, int isStruct
305305
goto error;
306306
}
307307

308-
size = PyObject_GetAttr(layout, &_Py_ID(size));
309-
if (!size) {
308+
size_obj = PyObject_GetAttr(layout, &_Py_ID(size));
309+
if (!size_obj) {
310310
goto error;
311311
}
312-
Py_ssize_t total_size = PyLong_AsSsize_t(size);
313-
Py_CLEAR(size);
312+
Py_ssize_t total_size = PyLong_AsSsize_t(size_obj);
313+
Py_CLEAR(size_obj);
314314
if (total_size < 0) {
315315
if (!PyErr_Occurred()) {
316316
PyErr_SetString(PyExc_ValueError,
@@ -669,8 +669,8 @@ PyCStructUnionType_update_stginfo(PyObject *type, PyObject *fields, int isStruct
669669
error:
670670
Py_XDECREF(layout_func);
671671
Py_XDECREF(kwnames);
672-
Py_XDECREF(align);
673-
Py_XDECREF(size);
672+
Py_XDECREF(align_obj);
673+
Py_XDECREF(size_obj);
674674
Py_XDECREF(layout_fields_obj);
675675
Py_XDECREF(layout_fields);
676676
Py_XDECREF(layout);

0 commit comments

Comments
 (0)
0