File tree 2 files changed +8
-8
lines changed
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -6093,14 +6093,19 @@ _ctypes_mod_exec(PyObject *mod)
6093
6093
}
6094
6094
6095
6095
#ifdef WORDS_BIGENDIAN
6096
- st -> swapped_suffix = PyUnicode_InternFromString ("_le" );
6096
+ st -> swapped_suffix = PyUnicode_InternFromString ("_le" );
6097
6097
#else
6098
- st -> swapped_suffix = PyUnicode_InternFromString ("_be" );
6098
+ st -> swapped_suffix = PyUnicode_InternFromString ("_be" );
6099
6099
#endif
6100
6100
if (st -> swapped_suffix == NULL ) {
6101
6101
return -1 ;
6102
6102
}
6103
6103
6104
+ st -> error_object_name = PyUnicode_InternFromString ("ctypes.error_object" );
6105
+ if (st -> error_object_name == NULL ) {
6106
+ return -1 ;
6107
+ }
6108
+
6104
6109
if (_ctypes_add_types (mod ) < 0 ) {
6105
6110
return -1 ;
6106
6111
}
Original file line number Diff line number Diff line change @@ -164,12 +164,7 @@ _ctypes_get_errobj(ctypes_state *st, int **pspace)
164
164
"cannot get thread state" );
165
165
return NULL ;
166
166
}
167
- if (st -> error_object_name == NULL ) {
168
- st -> error_object_name = PyUnicode_InternFromString ("ctypes.error_object" );
169
- if (st -> error_object_name == NULL ) {
170
- return NULL ;
171
- }
172
- }
167
+ assert (st -> error_object_name != NULL );
173
168
if (PyDict_GetItemRef (dict , st -> error_object_name , & errobj ) < 0 ) {
174
169
return NULL ;
175
170
}
You can’t perform that action at this time.
0 commit comments