Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -6093,14 +6093,19 @@ _ctypes_mod_exec(PyObject *mod)
}

#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;
}
Expand Down
7 changes: 1 addition & 6 deletions Modules/_ctypes/callproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,7 @@ _ctypes_get_errobj(ctypes_state *st, int **pspace)
"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;
}
Expand Down
Loading