}
#ifdef WORDS_BIGENDIAN
- st->swapped_suffix = PyUnicode_InternFromString("_le");
+ st->swapped_suffix = PyUnicode_InternFromString("_le");
#else
- st->swapped_suffix = PyUnicode_InternFromString("_be");
+ st->swapped_suffix = PyUnicode_InternFromString("_be");
#endif
if (st->swapped_suffix == NULL) {
return -1;
}
+ st->error_object_name = PyUnicode_InternFromString("ctypes.error_object");
+ if (st->error_object_name == NULL) {
+ return -1;
+ }
+
if (_ctypes_add_types(mod) < 0) {
return -1;
}
"cannot get thread state");
return NULL;
}
- if (st->error_object_name == NULL) {
- st->error_object_name = PyUnicode_InternFromString("ctypes.error_object");
- if (st->error_object_name == NULL) {
- return NULL;
- }
- }
+ assert(st->error_object_name != NULL);
if (PyDict_GetItemRef(dict, st->error_object_name, &errobj) < 0) {
return NULL;
}