STRUCT_FOR_ID(__complex__)
STRUCT_FOR_ID(__contains__)
STRUCT_FOR_ID(__copy__)
+ STRUCT_FOR_ID(__ctypes_from_outparam__)
STRUCT_FOR_ID(__del__)
STRUCT_FOR_ID(__delattr__)
STRUCT_FOR_ID(__delete__)
STRUCT_FOR_ID(__weakref__)
STRUCT_FOR_ID(__xor__)
STRUCT_FOR_ID(_abc_impl)
+ STRUCT_FOR_ID(_abstract_)
STRUCT_FOR_ID(_annotation)
+ STRUCT_FOR_ID(_anonymous_)
+ STRUCT_FOR_ID(_argtypes_)
+ STRUCT_FOR_ID(_as_parameter_)
STRUCT_FOR_ID(_asyncio_future_blocking)
STRUCT_FOR_ID(_blksize)
STRUCT_FOR_ID(_bootstrap)
+ STRUCT_FOR_ID(_check_retval_)
STRUCT_FOR_ID(_dealloc_warn)
STRUCT_FOR_ID(_feature_version)
+ STRUCT_FOR_ID(_fields_)
STRUCT_FOR_ID(_finalizing)
STRUCT_FOR_ID(_find_and_load)
STRUCT_FOR_ID(_fix_up_module)
+ STRUCT_FOR_ID(_flags_)
STRUCT_FOR_ID(_get_sourcefile)
STRUCT_FOR_ID(_handle_fromlist)
STRUCT_FOR_ID(_initializing)
STRUCT_FOR_ID(_is_text_encoding)
+ STRUCT_FOR_ID(_length_)
STRUCT_FOR_ID(_lock_unlock_module)
STRUCT_FOR_ID(_loop)
+ STRUCT_FOR_ID(_needs_com_addref_)
+ STRUCT_FOR_ID(_pack_)
+ STRUCT_FOR_ID(_restype_)
STRUCT_FOR_ID(_showwarnmsg)
STRUCT_FOR_ID(_shutdown)
STRUCT_FOR_ID(_slotnames)
+ 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)
STRUCT_FOR_ID(follow_symlinks)
STRUCT_FOR_ID(format)
STRUCT_FOR_ID(frequency)
+ STRUCT_FOR_ID(from_param)
STRUCT_FOR_ID(fromlist)
STRUCT_FOR_ID(fset)
STRUCT_FOR_ID(func)
INIT_ID(__complex__), \
INIT_ID(__contains__), \
INIT_ID(__copy__), \
+ INIT_ID(__ctypes_from_outparam__), \
INIT_ID(__del__), \
INIT_ID(__delattr__), \
INIT_ID(__delete__), \
INIT_ID(__weakref__), \
INIT_ID(__xor__), \
INIT_ID(_abc_impl), \
+ INIT_ID(_abstract_), \
INIT_ID(_annotation), \
+ INIT_ID(_anonymous_), \
+ INIT_ID(_argtypes_), \
+ INIT_ID(_as_parameter_), \
INIT_ID(_asyncio_future_blocking), \
INIT_ID(_blksize), \
INIT_ID(_bootstrap), \
+ INIT_ID(_check_retval_), \
INIT_ID(_dealloc_warn), \
INIT_ID(_feature_version), \
+ INIT_ID(_fields_), \
INIT_ID(_finalizing), \
INIT_ID(_find_and_load), \
INIT_ID(_fix_up_module), \
+ INIT_ID(_flags_), \
INIT_ID(_get_sourcefile), \
INIT_ID(_handle_fromlist), \
INIT_ID(_initializing), \
INIT_ID(_is_text_encoding), \
+ INIT_ID(_length_), \
INIT_ID(_lock_unlock_module), \
INIT_ID(_loop), \
+ INIT_ID(_needs_com_addref_), \
+ INIT_ID(_pack_), \
+ INIT_ID(_restype_), \
INIT_ID(_showwarnmsg), \
INIT_ID(_shutdown), \
INIT_ID(_slotnames), \
+ 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), \
INIT_ID(follow_symlinks), \
INIT_ID(format), \
INIT_ID(frequency), \
+ INIT_ID(from_param), \
INIT_ID(fromlist), \
INIT_ID(fset), \
INIT_ID(func), \
PyUnicode_InternInPlace(&string);
string = &_Py_ID(__copy__);
PyUnicode_InternInPlace(&string);
+ string = &_Py_ID(__ctypes_from_outparam__);
+ PyUnicode_InternInPlace(&string);
string = &_Py_ID(__del__);
PyUnicode_InternInPlace(&string);
string = &_Py_ID(__delattr__);
PyUnicode_InternInPlace(&string);
string = &_Py_ID(_abc_impl);
PyUnicode_InternInPlace(&string);
+ string = &_Py_ID(_abstract_);
+ PyUnicode_InternInPlace(&string);
string = &_Py_ID(_annotation);
PyUnicode_InternInPlace(&string);
+ string = &_Py_ID(_anonymous_);
+ PyUnicode_InternInPlace(&string);
+ string = &_Py_ID(_argtypes_);
+ PyUnicode_InternInPlace(&string);
+ string = &_Py_ID(_as_parameter_);
+ PyUnicode_InternInPlace(&string);
string = &_Py_ID(_asyncio_future_blocking);
PyUnicode_InternInPlace(&string);
string = &_Py_ID(_blksize);
PyUnicode_InternInPlace(&string);
string = &_Py_ID(_bootstrap);
PyUnicode_InternInPlace(&string);
+ string = &_Py_ID(_check_retval_);
+ PyUnicode_InternInPlace(&string);
string = &_Py_ID(_dealloc_warn);
PyUnicode_InternInPlace(&string);
string = &_Py_ID(_feature_version);
PyUnicode_InternInPlace(&string);
+ string = &_Py_ID(_fields_);
+ PyUnicode_InternInPlace(&string);
string = &_Py_ID(_finalizing);
PyUnicode_InternInPlace(&string);
string = &_Py_ID(_find_and_load);
PyUnicode_InternInPlace(&string);
string = &_Py_ID(_fix_up_module);
PyUnicode_InternInPlace(&string);
+ string = &_Py_ID(_flags_);
+ PyUnicode_InternInPlace(&string);
string = &_Py_ID(_get_sourcefile);
PyUnicode_InternInPlace(&string);
string = &_Py_ID(_handle_fromlist);
PyUnicode_InternInPlace(&string);
string = &_Py_ID(_is_text_encoding);
PyUnicode_InternInPlace(&string);
+ string = &_Py_ID(_length_);
+ PyUnicode_InternInPlace(&string);
string = &_Py_ID(_lock_unlock_module);
PyUnicode_InternInPlace(&string);
string = &_Py_ID(_loop);
PyUnicode_InternInPlace(&string);
+ string = &_Py_ID(_needs_com_addref_);
+ PyUnicode_InternInPlace(&string);
+ string = &_Py_ID(_pack_);
+ PyUnicode_InternInPlace(&string);
+ string = &_Py_ID(_restype_);
+ PyUnicode_InternInPlace(&string);
string = &_Py_ID(_showwarnmsg);
PyUnicode_InternInPlace(&string);
string = &_Py_ID(_shutdown);
PyUnicode_InternInPlace(&string);
string = &_Py_ID(_slotnames);
PyUnicode_InternInPlace(&string);
+ string = &_Py_ID(_swappedbytes_);
+ PyUnicode_InternInPlace(&string);
+ string = &_Py_ID(_type_);
+ 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);
PyUnicode_InternInPlace(&string);
string = &_Py_ID(frequency);
PyUnicode_InternInPlace(&string);
+ string = &_Py_ID(from_param);
+ PyUnicode_InternInPlace(&string);
string = &_Py_ID(fromlist);
PyUnicode_InternInPlace(&string);
string = &_Py_ID(fset);
_PyObject_Dump((PyObject *)&_Py_ID(__copy__));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
};
+ if (Py_REFCNT((PyObject *)&_Py_ID(__ctypes_from_outparam__)) < _PyObject_IMMORTAL_REFCNT) {
+ _PyObject_Dump((PyObject *)&_Py_ID(__ctypes_from_outparam__));
+ Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
+ };
if (Py_REFCNT((PyObject *)&_Py_ID(__del__)) < _PyObject_IMMORTAL_REFCNT) {
_PyObject_Dump((PyObject *)&_Py_ID(__del__));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
_PyObject_Dump((PyObject *)&_Py_ID(_abc_impl));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
};
+ if (Py_REFCNT((PyObject *)&_Py_ID(_abstract_)) < _PyObject_IMMORTAL_REFCNT) {
+ _PyObject_Dump((PyObject *)&_Py_ID(_abstract_));
+ Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
+ };
if (Py_REFCNT((PyObject *)&_Py_ID(_annotation)) < _PyObject_IMMORTAL_REFCNT) {
_PyObject_Dump((PyObject *)&_Py_ID(_annotation));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
};
+ if (Py_REFCNT((PyObject *)&_Py_ID(_anonymous_)) < _PyObject_IMMORTAL_REFCNT) {
+ _PyObject_Dump((PyObject *)&_Py_ID(_anonymous_));
+ Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
+ };
+ if (Py_REFCNT((PyObject *)&_Py_ID(_argtypes_)) < _PyObject_IMMORTAL_REFCNT) {
+ _PyObject_Dump((PyObject *)&_Py_ID(_argtypes_));
+ Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
+ };
+ if (Py_REFCNT((PyObject *)&_Py_ID(_as_parameter_)) < _PyObject_IMMORTAL_REFCNT) {
+ _PyObject_Dump((PyObject *)&_Py_ID(_as_parameter_));
+ Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
+ };
if (Py_REFCNT((PyObject *)&_Py_ID(_asyncio_future_blocking)) < _PyObject_IMMORTAL_REFCNT) {
_PyObject_Dump((PyObject *)&_Py_ID(_asyncio_future_blocking));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
_PyObject_Dump((PyObject *)&_Py_ID(_bootstrap));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
};
+ if (Py_REFCNT((PyObject *)&_Py_ID(_check_retval_)) < _PyObject_IMMORTAL_REFCNT) {
+ _PyObject_Dump((PyObject *)&_Py_ID(_check_retval_));
+ Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
+ };
if (Py_REFCNT((PyObject *)&_Py_ID(_dealloc_warn)) < _PyObject_IMMORTAL_REFCNT) {
_PyObject_Dump((PyObject *)&_Py_ID(_dealloc_warn));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
_PyObject_Dump((PyObject *)&_Py_ID(_feature_version));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
};
+ if (Py_REFCNT((PyObject *)&_Py_ID(_fields_)) < _PyObject_IMMORTAL_REFCNT) {
+ _PyObject_Dump((PyObject *)&_Py_ID(_fields_));
+ Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
+ };
if (Py_REFCNT((PyObject *)&_Py_ID(_finalizing)) < _PyObject_IMMORTAL_REFCNT) {
_PyObject_Dump((PyObject *)&_Py_ID(_finalizing));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
_PyObject_Dump((PyObject *)&_Py_ID(_fix_up_module));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
};
+ if (Py_REFCNT((PyObject *)&_Py_ID(_flags_)) < _PyObject_IMMORTAL_REFCNT) {
+ _PyObject_Dump((PyObject *)&_Py_ID(_flags_));
+ Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
+ };
if (Py_REFCNT((PyObject *)&_Py_ID(_get_sourcefile)) < _PyObject_IMMORTAL_REFCNT) {
_PyObject_Dump((PyObject *)&_Py_ID(_get_sourcefile));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
_PyObject_Dump((PyObject *)&_Py_ID(_is_text_encoding));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
};
+ if (Py_REFCNT((PyObject *)&_Py_ID(_length_)) < _PyObject_IMMORTAL_REFCNT) {
+ _PyObject_Dump((PyObject *)&_Py_ID(_length_));
+ Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
+ };
if (Py_REFCNT((PyObject *)&_Py_ID(_lock_unlock_module)) < _PyObject_IMMORTAL_REFCNT) {
_PyObject_Dump((PyObject *)&_Py_ID(_lock_unlock_module));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
_PyObject_Dump((PyObject *)&_Py_ID(_loop));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
};
+ if (Py_REFCNT((PyObject *)&_Py_ID(_needs_com_addref_)) < _PyObject_IMMORTAL_REFCNT) {
+ _PyObject_Dump((PyObject *)&_Py_ID(_needs_com_addref_));
+ Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
+ };
+ if (Py_REFCNT((PyObject *)&_Py_ID(_pack_)) < _PyObject_IMMORTAL_REFCNT) {
+ _PyObject_Dump((PyObject *)&_Py_ID(_pack_));
+ Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
+ };
+ if (Py_REFCNT((PyObject *)&_Py_ID(_restype_)) < _PyObject_IMMORTAL_REFCNT) {
+ _PyObject_Dump((PyObject *)&_Py_ID(_restype_));
+ Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
+ };
if (Py_REFCNT((PyObject *)&_Py_ID(_showwarnmsg)) < _PyObject_IMMORTAL_REFCNT) {
_PyObject_Dump((PyObject *)&_Py_ID(_showwarnmsg));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
_PyObject_Dump((PyObject *)&_Py_ID(_slotnames));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
};
+ if (Py_REFCNT((PyObject *)&_Py_ID(_swappedbytes_)) < _PyObject_IMMORTAL_REFCNT) {
+ _PyObject_Dump((PyObject *)&_Py_ID(_swappedbytes_));
+ Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
+ };
+ if (Py_REFCNT((PyObject *)&_Py_ID(_type_)) < _PyObject_IMMORTAL_REFCNT) {
+ _PyObject_Dump((PyObject *)&_Py_ID(_type_));
+ Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
+ };
if (Py_REFCNT((PyObject *)&_Py_ID(_uninitialized_submodules)) < _PyObject_IMMORTAL_REFCNT) {
_PyObject_Dump((PyObject *)&_Py_ID(_uninitialized_submodules));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
};
+ if (Py_REFCNT((PyObject *)&_Py_ID(_use_broken_old_ctypes_structure_semantics_)) < _PyObject_IMMORTAL_REFCNT) {
+ _PyObject_Dump((PyObject *)&_Py_ID(_use_broken_old_ctypes_structure_semantics_));
+ Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
+ };
if (Py_REFCNT((PyObject *)&_Py_ID(_warn_unawaited_coroutine)) < _PyObject_IMMORTAL_REFCNT) {
_PyObject_Dump((PyObject *)&_Py_ID(_warn_unawaited_coroutine));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
_PyObject_Dump((PyObject *)&_Py_ID(frequency));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
};
+ if (Py_REFCNT((PyObject *)&_Py_ID(from_param)) < _PyObject_IMMORTAL_REFCNT) {
+ _PyObject_Dump((PyObject *)&_Py_ID(from_param));
+ Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
+ };
if (Py_REFCNT((PyObject *)&_Py_ID(fromlist)) < _PyObject_IMMORTAL_REFCNT) {
_PyObject_Dump((PyObject *)&_Py_ID(fromlist));
Py_FatalError("immortal object has less refcnt than expected _PyObject_IMMORTAL_REFCNT");
#ifndef Py_BUILD_CORE_BUILTIN
# define Py_BUILD_CORE_MODULE 1
#endif
-#define NEEDS_PY_IDENTIFIER
-
#define PY_SSIZE_T_CLEAN
#include "Python.h"
PyTypeObject *result;
PyObject *fields;
StgDictObject *dict;
- _Py_IDENTIFIER(_abstract_);
- _Py_IDENTIFIER(_fields_);
/* create the new instance (which is a class,
since we are a metatype!) */
return NULL;
/* keep this for bw compatibility */
- int r = _PyDict_ContainsId(result->tp_dict, &PyId__abstract_);
+ int r = PyDict_Contains(result->tp_dict, &_Py_ID(_abstract_));
if (r > 0)
return (PyObject *)result;
if (r < 0) {
dict->paramfunc = StructUnionType_paramfunc;
- fields = _PyDict_GetItemIdWithError((PyObject *)dict, &PyId__fields_);
+ fields = PyDict_GetItemWithError((PyObject *)dict, &_Py_ID(_fields_));
if (fields) {
- if (_PyObject_SetAttrId((PyObject *)result, &PyId__fields_, fields) < 0) {
+ if (PyObject_SetAttr((PyObject *)result, &_Py_ID(_fields_), fields) < 0) {
Py_DECREF(result);
return NULL;
}
static PyObject *
CDataType_from_param(PyObject *type, PyObject *value)
{
- _Py_IDENTIFIER(_as_parameter_);
PyObject *as_parameter;
int res = PyObject_IsInstance(value, type);
if (res == -1)
return NULL;
}
- if (_PyObject_LookupAttrId(value, &PyId__as_parameter_, &as_parameter) < 0) {
+ if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
return NULL;
}
if (as_parameter) {
StgDictObject *stgdict;
PyObject *proto;
PyObject *typedict;
- _Py_IDENTIFIER(_type_);
+
typedict = PyTuple_GetItem(args, 2);
if (!typedict)
stgdict->paramfunc = PyCPointerType_paramfunc;
stgdict->flags |= TYPEFLAG_ISPOINTER;
- proto = _PyDict_GetItemIdWithError(typedict, &PyId__type_); /* Borrowed ref */
+ proto = PyDict_GetItemWithError(typedict, &_Py_ID(_type_)); /* Borrowed ref */
if (proto) {
StgDictObject *itemdict;
const char *current_format;
PyCPointerType_set_type(PyTypeObject *self, PyObject *type)
{
StgDictObject *dict;
- _Py_IDENTIFIER(_type_);
+
dict = PyType_stgdict((PyObject *)self);
if (!dict) {
if (-1 == PyCPointerType_SetProto(dict, type))
return NULL;
- if (-1 == _PyDict_SetItemId((PyObject *)dict, &PyId__type_, type))
+ if (-1 == PyDict_SetItem((PyObject *)dict, &_Py_ID(_type_), type))
return NULL;
Py_RETURN_NONE;
static PyObject *
PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
- _Py_IDENTIFIER(_length_);
- _Py_IDENTIFIER(_type_);
PyTypeObject *result;
StgDictObject *stgdict;
StgDictObject *itemdict;
stgdict = NULL;
type_attr = NULL;
- if (_PyObject_LookupAttrId((PyObject *)result, &PyId__length_, &length_attr) < 0) {
+ if (_PyObject_LookupAttr((PyObject *)result, &_Py_ID(_length_), &length_attr) < 0) {
goto error;
}
if (!length_attr) {
goto error;
}
- if (_PyObject_LookupAttrId((PyObject *)result, &PyId__type_, &type_attr) < 0) {
+ if (_PyObject_LookupAttr((PyObject *)result, &_Py_ID(_type_), &type_attr) < 0) {
goto error;
}
if (!type_attr) {
static PyObject *
c_wchar_p_from_param(PyObject *type, PyObject *value)
{
- _Py_IDENTIFIER(_as_parameter_);
PyObject *as_parameter;
int res;
if (value == Py_None) {
}
}
- if (_PyObject_LookupAttrId(value, &PyId__as_parameter_, &as_parameter) < 0) {
+ if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
return NULL;
}
if (as_parameter) {
static PyObject *
c_char_p_from_param(PyObject *type, PyObject *value)
{
- _Py_IDENTIFIER(_as_parameter_);
PyObject *as_parameter;
int res;
if (value == Py_None) {
}
}
- if (_PyObject_LookupAttrId(value, &PyId__as_parameter_, &as_parameter) < 0) {
+ if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
return NULL;
}
if (as_parameter) {
static PyObject *
c_void_p_from_param(PyObject *type, PyObject *value)
{
- _Py_IDENTIFIER(_as_parameter_);
StgDictObject *stgd;
PyObject *as_parameter;
int res;
}
}
- if (_PyObject_LookupAttrId(value, &PyId__as_parameter_, &as_parameter) < 0) {
+ if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
return NULL;
}
if (as_parameter) {
static PyObject *
PyCSimpleType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
- _Py_IDENTIFIER(_type_);
PyTypeObject *result;
StgDictObject *stgdict;
PyObject *proto;
if (result == NULL)
return NULL;
- if (_PyObject_LookupAttrId((PyObject *)result, &PyId__type_, &proto) < 0) {
+ if (_PyObject_LookupAttr((PyObject *)result, &_Py_ID(_type_), &proto) < 0) {
return NULL;
}
if (!proto) {
static PyObject *
PyCSimpleType_from_param(PyObject *type, PyObject *value)
{
- _Py_IDENTIFIER(_as_parameter_);
StgDictObject *dict;
const char *fmt;
PyCArgObject *parg;
PyErr_Clear();
Py_DECREF(parg);
- if (_PyObject_LookupAttrId(value, &PyId__as_parameter_, &as_parameter) < 0) {
+ if (_PyObject_LookupAttr(value, &_Py_ID(_as_parameter_), &as_parameter) < 0) {
return NULL;
}
if (as_parameter) {
static PyObject *
converters_from_argtypes(PyObject *ob)
{
- _Py_IDENTIFIER(from_param);
PyObject *converters;
Py_ssize_t i;
}
*/
- if (_PyObject_LookupAttrId(tp, &PyId_from_param, &cnv) <= 0) {
+ if (_PyObject_LookupAttr(tp, &_Py_ID(from_param), &cnv) <= 0) {
Py_DECREF(converters);
Py_DECREF(ob);
if (!PyErr_Occurred()) {
{
PyObject *ob;
PyObject *converters = NULL;
- _Py_IDENTIFIER(_flags_);
- _Py_IDENTIFIER(_argtypes_);
- _Py_IDENTIFIER(_restype_);
- _Py_IDENTIFIER(_check_retval_);
stgdict->align = _ctypes_get_fielddesc("P")->pffi_type->alignment;
stgdict->length = 1;
stgdict->getfunc = NULL;
stgdict->ffi_type_pointer = ffi_type_pointer;
- ob = _PyDict_GetItemIdWithError((PyObject *)stgdict, &PyId__flags_);
+ ob = PyDict_GetItemWithError((PyObject *)stgdict, &_Py_ID(_flags_));
if (!ob || !PyLong_Check(ob)) {
if (!PyErr_Occurred()) {
PyErr_SetString(PyExc_TypeError,
stgdict->flags = PyLong_AsUnsignedLongMask(ob) | TYPEFLAG_ISPOINTER;
/* _argtypes_ is optional... */
- ob = _PyDict_GetItemIdWithError((PyObject *)stgdict, &PyId__argtypes_);
+ ob = PyDict_GetItemWithError((PyObject *)stgdict, &_Py_ID(_argtypes_));
if (ob) {
converters = converters_from_argtypes(ob);
if (!converters)
return -1;
}
- ob = _PyDict_GetItemIdWithError((PyObject *)stgdict, &PyId__restype_);
+ ob = PyDict_GetItemWithError((PyObject *)stgdict, &_Py_ID(_restype_));
if (ob) {
if (ob != Py_None && !PyType_stgdict(ob) && !PyCallable_Check(ob)) {
PyErr_SetString(PyExc_TypeError,
}
Py_INCREF(ob);
stgdict->restype = ob;
- if (_PyObject_LookupAttrId(ob, &PyId__check_retval_,
+ if (_PyObject_LookupAttr(ob, &_Py_ID(_check_retval_),
&stgdict->checker) < 0)
{
return -1;
static int
PyCFuncPtr_set_restype(PyCFuncPtrObject *self, PyObject *ob, void *Py_UNUSED(ignored))
{
- _Py_IDENTIFIER(_check_retval_);
PyObject *checker, *oldchecker;
if (ob == NULL) {
oldchecker = self->checker;
"restype must be a type, a callable, or None");
return -1;
}
- if (_PyObject_LookupAttrId(ob, &PyId__check_retval_, &checker) < 0) {
+ if (_PyObject_LookupAttr(ob, &_Py_ID(_check_retval_), &checker) < 0) {
return -1;
}
oldchecker = self->checker;
PyTuple_SET_ITEM(tup, index, v);
index++;
} else if (bit & outmask) {
- _Py_IDENTIFIER(__ctypes_from_outparam__);
v = PyTuple_GET_ITEM(callargs, i);
- v = _PyObject_CallMethodIdNoArgs(v, &PyId___ctypes_from_outparam__);
+ v = PyObject_CallMethodNoArgs(v, &_Py_ID(__ctypes_from_outparam__));
if (v == NULL || numretvals == 1) {
Py_DECREF(callargs);
return v;
StgDictObject *dict;
PyObject *fields;
Py_ssize_t i;
- _Py_IDENTIFIER(_fields_);
if (PyType_stgdict((PyObject *)type->tp_base)) {
index = _init_pos_args(self, type->tp_base,
}
dict = PyType_stgdict((PyObject *)type);
- fields = _PyDict_GetItemIdWithError((PyObject *)dict, &PyId__fields_);
+ fields = PyDict_GetItemWithError((PyObject *)dict, &_Py_ID(_fields_));
if (fields == NULL) {
if (PyErr_Occurred()) {
return -1;
#ifndef Py_BUILD_CORE_BUILTIN
# define Py_BUILD_CORE_MODULE 1
#endif
-#define NEEDS_PY_IDENTIFIER
#include "Python.h"
// windows.h must be included before pycore internal headers
#endif
#include "pycore_call.h" // _PyObject_CallNoArgs()
+#include "pycore_runtime_init.h" // _Py_ID()
#include <stdbool.h>
TryAddRef(StgDictObject *dict, CDataObject *obj)
{
IUnknown *punk;
- _Py_IDENTIFIER(_needs_com_addref_);
-
- int r = _PyDict_ContainsId((PyObject *)dict, &PyId__needs_com_addref_);
+ int r = PyDict_Contains((PyObject *)dict, &_Py_ID(_needs_com_addref_));
if (r <= 0) {
if (r < 0) {
PrintError("getting _needs_com_addref_");
#ifndef Py_BUILD_CORE_BUILTIN
# define Py_BUILD_CORE_MODULE 1
#endif
-#define NEEDS_PY_IDENTIFIER
#include "Python.h"
#include "structmember.h" // PyMemberDef
#define DONT_USE_SEH
#endif
+#include "pycore_runtime_init.h"
+
#define CTYPES_CAPSULE_NAME_PYMEM "_ctypes pymem"
static void pymem_destructor(PyObject *ptr)
}
{
- _Py_IDENTIFIER(_as_parameter_);
PyObject *arg;
- if (_PyObject_LookupAttrId(obj, &PyId__as_parameter_, &arg) < 0) {
+ if (_PyObject_LookupAttr(obj, &_Py_ID(_as_parameter_), &arg) < 0) {
return -1;
}
/* Which types should we exactly allow here?
unpickle(PyObject *self, PyObject *args)
{
PyObject *typ, *state, *meth, *obj, *result;
- _Py_IDENTIFIER(__new__);
- _Py_IDENTIFIER(__setstate__);
if (!PyArg_ParseTuple(args, "OO!", &typ, &PyTuple_Type, &state))
return NULL;
- obj = _PyObject_CallMethodIdOneArg(typ, &PyId___new__, typ);
+ obj = PyObject_CallMethodOneArg(typ, &_Py_ID(__new__), typ);
if (obj == NULL)
return NULL;
- meth = _PyObject_GetAttrId(obj, &PyId___setstate__);
+ meth = PyObject_GetAttr(obj, &_Py_ID(__setstate__));
if (meth == NULL) {
goto error;
}
#ifndef Py_BUILD_CORE_BUILTIN
# define Py_BUILD_CORE_MODULE 1
#endif
-#define NEEDS_PY_IDENTIFIER
#include "Python.h"
// windows.h must be included before pycore internal headers
static int
MakeAnonFields(PyObject *type)
{
- _Py_IDENTIFIER(_anonymous_);
PyObject *anon;
PyObject *anon_names;
Py_ssize_t i;
- if (_PyObject_LookupAttrId(type, &PyId__anonymous_, &anon) < 0) {
+ if (_PyObject_LookupAttr(type, &_Py_ID(_anonymous_), &anon) < 0) {
return -1;
}
if (anon == NULL) {
int
PyCStructUnionType_update_stgdict(PyObject *type, PyObject *fields, int isStruct)
{
- _Py_IDENTIFIER(_swappedbytes_);
- _Py_IDENTIFIER(_use_broken_old_ctypes_structure_semantics_);
- _Py_IDENTIFIER(_pack_);
StgDictObject *stgdict, *basedict;
Py_ssize_t len, offset, size, align, i;
Py_ssize_t union_size, total_align;
if (fields == NULL)
return 0;
- if (_PyObject_LookupAttrId(type, &PyId__swappedbytes_, &tmp) < 0) {
+ if (_PyObject_LookupAttr(type, &_Py_ID(_swappedbytes_), &tmp) < 0) {
return -1;
}
if (tmp) {
big_endian = PY_BIG_ENDIAN;
}
- if (_PyObject_LookupAttrId(type,
- &PyId__use_broken_old_ctypes_structure_semantics_, &tmp) < 0)
+ if (_PyObject_LookupAttr(type,
+ &_Py_ID(_use_broken_old_ctypes_structure_semantics_), &tmp) < 0)
{
return -1;
}
use_broken_old_ctypes_semantics = 0;
}
- if (_PyObject_LookupAttrId(type, &PyId__pack_, &tmp) < 0) {
+ if (_PyObject_LookupAttr(type, &_Py_ID(_pack_), &tmp) < 0) {
return -1;
}
if (tmp) {