8000 nit · python/cpython@d92e896 · GitHub
[go: up one dir, main page]

Skip to content

Commit d92e896

Browse files
authored
nit
1 parent 525de82 commit d92e896

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Modules/_ctypes/_ctypes.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,7 +2041,6 @@ PyCSimpleType_init(PyObject *self, PyObject *args, PyObject *kwds)
20412041
/* create the new instance (which is a class,
20422042
since we are a metatype!) */
20432043
result = (PyTypeObject *)self; // by PyType_Type.tp_new()
2044-
PyTypeObject *type = Py_TYPE(self);
20452044

20462045
ctypes_state *st = GLOBAL_STATE();
20472046

@@ -2169,6 +2168,7 @@ PyCSimpleType_init(PyObject *self, PyObject *args, PyObject *kwds)
21692168
}
21702169
}
21712170

2171+
PyTypeObject *type = Py_TYPE(self);
21722172
if (type == &PyCSimpleType_Type && fmt->setfunc_swapped && fmt->getfunc_swapped) {
21732173
PyObject *swapped = CreateSwappedType(type, args, kwds,
21742174
proto, fmt);
@@ -3035,6 +3035,7 @@ int _ctypes_simple_instance(PyObject *obj)
30353035
{
30363036
PyTypeObject *type = (PyTypeObject *)obj;
30373037
ctypes_state *st = GLOBAL_STATE();
3038+
30383039
if (PyCSimpleTypeObject_Check(type)) {
30393040
return type->tp_base != st->Simple_Type;
30403041
}
@@ -5702,7 +5703,7 @@ _ctypes_add_types(PyObject *mod)
57025703
MOD_ADD_TYPE(&PyCPointer_Type, &PyCPointerType_Type, &PyCData_Type);
57035704
MOD_ADD_TYPE(&PyCArray_Type, &PyCArrayType_Type, &PyCData_Type);
57045705
MOD_ADD_HEAPTYPE(st->Simple_Type, &simple_spec, &PyCData_Type,
5705-
&PyCSimpleType_Type);
5706+
&PyCSimpleType_Type);
57065707
MOD_ADD_TYPE(&PyCFuncPtr_Type, &PyCFuncPtrType_Type, &PyCData_Type);
57075708

57085709
/*************************************************

0 commit comments

Comments
 (0)
0