File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 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)
60936093 }
60946094
60956095#ifdef WORDS_BIGENDIAN
6096- st -> swapped_suffix = PyUnicode_InternFromString ("_le" );
6096+ st -> swapped_suffix = PyUnicode_InternFromString ("_le" );
60976097#else
6098- st -> swapped_suffix = PyUnicode_InternFromString ("_be" );
6098+ st -> swapped_suffix = PyUnicode_InternFromString ("_be" );
60996099#endif
61006100 if (st -> swapped_suffix == NULL ) {
61016101 return -1 ;
61026102 }
61036103
6104+ st -> error_object_name = PyUnicode_InternFromString ("ctypes.error_object" );
6105+ if (st -> error_object_name == NULL ) {
6106+ return -1 ;
6107+ }
6108+
61046109 if (_ctypes_add_types (mod ) < 0 ) {
61056110 return -1 ;
61066111 }
Original file line number Diff line number Diff line change @@ -164,12 +164,7 @@ _ctypes_get_errobj(ctypes_state *st, int **pspace)
164164 "cannot get thread state" );
165165 return NULL ;
166166 }
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 );
173168 if (PyDict_GetItemRef (dict , st -> error_object_name , & errobj ) < 0 ) {
174169 return NULL ;
175170 }
You can’t perform that action at this time.
0 commit comments