It was untested and undocumented. No code has been found in the wild that ever used it.
* Remove the ``PyUnicode_InternImmortal()`` function and the
``SSTATE_INTERNED_IMMORTAL`` macro.
(Contributed by Victor Stinner in :gh:`85858`.)
+
+* Remove ``_use_broken_old_ctypes_structure_semantics_`` flag
+ from :mod:`ctypes` module.
+ (Contributed by Nikita Sobolev in :gh:`99285`.)
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(_swappedbytes_));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(_type_));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(_uninitialized_submodules));
- _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(_use_broken_old_ctypes_structure_semantics_));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(_warn_unawaited_coroutine));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(_xoptions));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(a));
STRUCT_FOR_ID(_swappedbytes_)
STRUCT_FOR_ID(_type_)
STRUCT_FOR_ID(_uninitialized_submodules)
- STRUCT_FOR_ID(_use_broken_old_ctypes_structure_semantics_)
STRUCT_FOR_ID(_warn_unawaited_coroutine)
STRUCT_FOR_ID(_xoptions)
STRUCT_FOR_ID(a)
INIT_ID(_swappedbytes_), \
INIT_ID(_type_), \
INIT_ID(_uninitialized_submodules), \
- INIT_ID(_use_broken_old_ctypes_structure_semantics_), \
INIT_ID(_warn_unawaited_coroutine), \
INIT_ID(_xoptions), \
INIT_ID(a), \
PyUnicode_InternInPlace(&string);
string = &_Py_ID(_uninitialized_submodules);
PyUnicode_InternInPlace(&string);
- string = &_Py_ID(_use_broken_old_ctypes_structure_semantics_);
- PyUnicode_InternInPlace(&string);
string = &_Py_ID(_warn_unawaited_coroutine);
PyUnicode_InternInPlace(&string);
string = &_Py_ID(_xoptions);
--- /dev/null
+Remove ``_use_broken_old_ctypes_structure_semantics_``
+old untested and undocumented hack from :mod:`ctypes`.
int big_endian;
int arrays_seen = 0;
- /* HACK Alert: I cannot be bothered to fix ctypes.com, so there has to
- be a way to use the old, broken semantics: _fields_ are not extended
- but replaced in subclasses.
-
- XXX Remove this in ctypes 1.0!
- */
- int use_broken_old_ctypes_semantics;
-
if (fields == NULL)
return 0;
big_endian = PY_BIG_ENDIAN;
}
- if (_PyObject_LookupAttr(type,
- &_Py_ID(_use_broken_old_ctypes_structure_semantics_), &tmp) < 0)
- {
- return -1;
- }
- if (tmp) {
- Py_DECREF(tmp);
- use_broken_old_ctypes_semantics = 1;
- }
- else {
- use_broken_old_ctypes_semantics = 0;
- }
-
if (_PyObject_LookupAttr(type, &_Py_ID(_pack_), &tmp) < 0) {
return -1;
}
if (!isStruct) {
stgdict->flags |= TYPEFLAG_HASUNION;
}
- if (basedict && !use_broken_old_ctypes_semantics) {
+ if (basedict) {
size = offset = basedict->size;
align = basedict->align;
union_size = 0;