Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Revert some replaces to fix tests.
  • Loading branch information
serhiy-storchaka committed Jul 25, 2023
commit cb327334c3cd97b3b39fe70d5e73053fd0812304
2 changes: 1 addition & 1 deletion Modules/_collectionsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2054,7 +2054,7 @@ static PyMethodDef defdict_methods[] = {
};

static PyMemberDef defdict_members[] = {
{"default_factory", Py_T_OBJECT_EX,
{"default_factory", _Py_T_OBJECT,
offsetof(defdictobject, default_factory), 0,
PyDoc_STR("Factory for default value called by __missing__().")},
{NULL}
Expand Down
2 changes: 1 addition & 1 deletion Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2765,7 +2765,7 @@ static PyMemberDef PyCData_members[] = {
{ "_b_needsfree_", Py_T_INT,
offsetof(CDataObject, b_needsfree), Py_READONLY,
"whether the object owns the memory or not" },
{ "_objects", Py_T_OBJECT_EX,
{ "_objects", _Py_T_OBJECT,
offsetof(CDataObject, b_objects), Py_READONLY,
"internal objects tree (NEVER CHANGE THIS OBJECT!)"},
{ NULL },
Expand Down
4 changes: 2 additions & 2 deletions Modules/_elementtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -4135,8 +4135,8 @@ _elementtree_XMLParser__setevents_impl(XMLParserObject *self,
}

static PyMemberDef xmlparser_members[] = {
{"entity", Py_T_OBJECT_EX, offsetof(XMLParserObject, entity), Py_READONLY, NULL},
{"target", Py_T_OBJECT_EX, offsetof(XMLParserObject, target), Py_READONLY, NULL},
{"entity", _Py_T_OBJECT, offsetof(XMLParserObject, entity), Py_READONLY, NULL},
{"target", _Py_T_OBJECT, offsetof(XMLParserObject, target), Py_READONLY, NULL},
{NULL}
};

Expand Down
6 changes: 3 additions & 3 deletions Objects/descrobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1516,9 +1516,9 @@ static PyObject * property_copy(PyObject *, PyObject *, PyObject *,

static PyMemberDef property_members[] = {
{"fget", Py_T_OBJECT_EX, offsetof(propertyobject, prop_get), Py_READONLY},
{"fset", Py_T_OBJECT_EX, offsetof(propertyobject, prop_set), Py_READONLY},
{"fdel", Py_T_OBJECT_EX, offsetof(propertyobject, prop_del), Py_READONLY},
{"__doc__", Py_T_OBJECT_EX, offsetof(propertyobject, prop_doc), 0},
{"fset", _Py_T_OBJECT, offsetof(propertyobject, prop_set), Py_READONLY},
{"fdel", _Py_T_OBJECT, offsetof(propertyobject, prop_del), Py_READONLY},
{"__doc__", _Py_T_OBJECT, offsetof(propertyobject, prop_doc), 0},
{0}
};

Expand Down
36 changes: 18 additions & 18 deletions Objects/exceptions.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ SystemExit_traverse(PySystemExitObject *self, visitproc visit, void *arg)
}

static PyMemberDef SystemExit_members[] = {
{"code", Py_T_OBJECT_EX, offsetof(PySystemExitObject, code), 0,
{"code", _Py_T_OBJECT, offsetof(PySystemExitObject, code), 0,
PyDoc_STR("exception code")},
{NULL} /* Sentinel */
};
Expand Down Expand Up @@ -1654,11 +1654,11 @@ ImportError_reduce(PyImportErrorObject *self, PyObject *Py_UNUSED(ignored))
}

static PyMemberDef ImportError_members[] = {
{"msg", Py_T_OBJECT_EX, offsetof(PyImportErrorObject, msg), 0,
{"msg", _Py_T_OBJECT, offsetof(PyImportErrorObject, msg), 0,
PyDoc_STR("exception message")},
{"name", Py_T_OBJECT_EX, offsetof(PyImportErrorObject, name), 0,
{"name", _Py_T_OBJECT, offsetof(PyImportErrorObject, name), 0,
PyDoc_STR("module name")},
{"path", Py_T_OBJECT_EX, offsetof(PyImportErrorObject, path), 0,
{"path", _Py_T_OBJECT, offsetof(PyImportErrorObject, path), 0,
PyDoc_STR("module path")},
{"name_from", Py_T_OBJECT_EX, offsetof(PyImportErrorObject, name_from), 0,
PyDoc_STR("name imported from module")},
Expand Down Expand Up @@ -2103,13 +2103,13 @@ OSError_written_set(PyOSErrorObject *self, PyObject *arg, void *context)
}

static PyMemberDef OSError_members[] = {
{"errno", Py_T_OBJECT_EX, offsetof(PyOSErrorObject, myerrno), 0,
{"errno", _Py_T_OBJECT, offsetof(PyOSErrorObject, myerrno), 0,
PyDoc_STR("POSIX exception code")},
{"strerror", Py_T_OBJECT_EX, offsetof(PyOSErrorObject, strerror), 0,
{"strerror", _Py_T_OBJECT, offsetof(PyOSErrorObject, strerror), 0,
PyDoc_STR("exception strerror")},
{"filename", Py_T_OBJECT_EX, offsetof(PyOSErrorObject, filename), 0,
{"filename", _Py_T_OBJECT, offsetof(PyOSErrorObject, filename), 0,
PyDoc_STR("exception filename")},
{"filename2", Py_T_OBJECT_EX, offsetof(PyOSErrorObject, filename2), 0,
{"filename2", _Py_T_OBJECT, offsetof(PyOSErrorObject, filename2), 0,
PyDoc_STR("second exception filename")},
#ifdef MS_WINDOWS
{"winerror", Py_T_OBJECT_EX, offsetof(PyOSErrorObject, winerror), 0,
Expand Down Expand Up @@ -2368,8 +2368,8 @@ AttributeError_reduce(PyAttributeErrorObject *self, PyObject *Py_UNUSED(ignored)
}

static PyMemberDef AttributeError_members[] = {
{"name", Py_T_OBJECT_EX, offsetof(PyAttributeErrorObject, name), 0, PyDoc_STR("attribute name")},
{"obj", Py_T_OBJECT_EX, offsetof(PyAttributeErrorObject, obj), 0, PyDoc_STR("object")},
{"name", _Py_T_OBJECT, offsetof(PyAttributeErrorObject, name), 0, PyDoc_STR("attribute name")},
{"obj", _Py_T_OBJECT, offsetof(PyAttributeErrorObject, obj), 0, PyDoc_STR("object")},
{NULL} /* Sentinel */
};

Expand Down Expand Up @@ -2541,21 +2541,21 @@ SyntaxError_str(PySyntaxErrorObject *self)
}

static PyMemberDef SyntaxError_members[] = {
{"msg", Py_T_OBJECT_EX, offsetof(PySyntaxErrorObject, msg), 0,
{"msg", _Py_T_OBJECT, offsetof(PySyntaxErrorObject, msg), 0,
PyDoc_STR("exception msg")},
{"filename", Py_T_OBJECT_EX, offsetof(PySyntaxErrorObject, filename), 0,
{"filename", _Py_T_OBJECT, offsetof(PySyntaxErrorObject, filename), 0,
PyDoc_STR("exception filename")},
{"lineno", Py_T_OBJECT_EX, offsetof(PySyntaxErrorObject, lineno), 0,
{"lineno", _Py_T_OBJECT, offsetof(PySyntaxErrorObject, lineno), 0,
PyDoc_STR("exception lineno")},
{"offset", Py_T_OBJECT_EX, offsetof(PySyntaxErrorObject, offset), 0,
{"offset", _Py_T_OBJECT, offsetof(PySyntaxErrorObject, offset), 0,
PyDoc_STR("exception offset")},
{"text", Py_T_OBJECT_EX, offsetof(PySyntaxErrorObject, text), 0,
{"text", _Py_T_OBJECT, offsetof(PySyntaxErrorObject, text), 0,
PyDoc_STR("exception text")},
{"end_lineno", Py_T_OBJECT_EX, offsetof(PySyntaxErrorObject, end_lineno), 0,
{"end_lineno", _Py_T_OBJECT, offsetof(PySyntaxErrorObject, end_lineno), 0,
PyDoc_STR("exception end lineno")},
{"end_offset", Py_T_OBJECT_EX, offsetof(PySyntaxErrorObject, end_offset), 0,
{"end_offset", _Py_T_OBJECT, offsetof(PySyntaxErrorObject, end_offset), 0,
PyDoc_STR("exception end offset")},
{"print_file_and_line", Py_T_OBJECT_EX,
{"print_file_and_line", _Py_T_OBJECT,
offsetof(PySyntaxErrorObject, print_file_and_line), 0,
PyDoc_STR("exception print_file_and_line")},
{NULL} /* Sentinel */
Expand Down
6 changes: 3 additions & 3 deletions Objects/funcobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,10 @@ PyFunction_SetAnnotations(PyObject *op, PyObject *annotations)
#define OFF(x) offsetof(PyFunctionObject, x)

static PyMemberDef func_memberlist[] = {
{"__closure__", Py_T_OBJECT_EX, OFF(func_closure), Py_READONLY},
{"__doc__", Py_T_OBJECT_EX, OFF(func_doc), 0},
{"__closure__", _Py_T_OBJECT, OFF(func_closure), Py_READONLY},
{"__doc__", _Py_T_OBJECT, OFF(func_doc), 0},
{"__globals__", Py_T_OBJECT_EX, OFF(func_globals), Py_READONLY},
{"__module__", Py_T_OBJECT_EX, OFF(func_module), 0},
{"__module__", _Py_T_OBJECT, OFF(func_module), 0},
{"__builtins__", Py_T_OBJECT_EX, OFF(func_builtins), Py_READONLY},
{NULL} /* Sentinel */
};
Expand Down
2 changes: 1 addition & 1 deletion Objects/genobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@ static PyGetSetDef coro_getsetlist[] = {
};

static PyMemberDef coro_memberlist[] = {
{"cr_origin", Py_T_OBJECT_EX, offsetof(PyCoroObject, cr_origin_or_finalizer), Py_READONLY},
{"cr_origin", _Py_T_OBJECT, offsetof(PyCoroObject, cr_origin_or_finalizer), Py_READONLY},
{NULL} /* Sentinel */
};

Expand Down
2 changes: 1 addition & 1 deletion Objects/methodobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ static PyGetSetDef meth_getsets [] = {
#define OFF(x) offsetof(PyCFunctionObject, x)

static PyMemberDef meth_members[] = {
{"__module__", Py_T_OBJECT_EX, OFF(m_module), 0},
{"__module__", _Py_T_OBJECT, OFF(m_module), 0},
{NULL}
};

Expand Down
2 changes: 1 addition & 1 deletion Objects/weakrefobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ weakref___init__(PyObject *self, PyObject *args, PyObject *kwargs)


static PyMemberDef weakref_members[] = {
{"__callback__", Py_T_OBJECT_EX, offsetof(PyWeakReference, wr_callback), Py_READONLY},
{"__callback__", _Py_T_OBJECT, offsetof(PyWeakReference, wr_callback), Py_READONLY},
{NULL} /* Sentinel */
};

Expand Down