summaryrefslogtreecommitdiffstats
path: root/Objects/structseq.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-05-02 02:34:43 (GMT)
committerGitHub <noreply@github.com>2023-05-02 02:34:43 (GMT)
commitf73abf8e03fd370c86fbb2a249fe1e065f7d84b4 (patch)
treefb471d3aafd99ade5905fe5292e807e5c4cad25a /Objects/structseq.c
parentfdd878650d325297cd801305bc2d1b0e903e42b4 (diff)
downloadcpython-f73abf8e03fd370c86fbb2a249fe1e065f7d84b4.zip
cpython-f73abf8e03fd370c86fbb2a249fe1e065f7d84b4.tar.gz
cpython-f73abf8e03fd370c86fbb2a249fe1e065f7d84b4.tar.bz2
gh-94673: Hide Objects in PyTypeObject Behind Accessors (gh-104074)
This makes it much cleaner to move more PyTypeObject fields to PyInterpreterState.
Diffstat (limited to 'Objects/structseq.c')
-rw-r--r--Objects/structseq.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Objects/structseq.c b/Objects/structseq.c
index ea476bf..f63660a 100644
--- a/Objects/structseq.c
+++ b/Objects/structseq.c
@@ -26,7 +26,7 @@ const char * const PyStructSequence_UnnamedField = "unnamed field";
static Py_ssize_t
get_type_attr_as_size(PyTypeObject *tp, PyObject *name)
{
- PyObject *v = PyDict_GetItemWithError(tp->tp_dict, name);
+ PyObject *v = PyDict_GetItemWithError(_PyType_GetDict(tp), name);
if (v == NULL && !PyErr_Occurred()) {
PyErr_Format(PyExc_TypeError,
"Missed attribute '%U' of type %s",
@@ -493,7 +493,7 @@ initialize_static_type(PyTypeObject *type, PyStructSequence_Desc *desc,
Py_INCREF(type);
if (initialize_structseq_dict(
- desc, type->tp_dict, n_members, n_unnamed_members) < 0) {
+ desc, _PyType_GetDict(type), n_members, n_unnamed_members) < 0) {
Py_DECREF(type);
return -1;
}
@@ -549,7 +549,7 @@ _PyStructSequence_InitBuiltinWithFlags(PyInterpreterState *interp,
}
if (initialize_structseq_dict(
- desc, type->tp_dict, n_members, n_unnamed_members) < 0) {
+ desc, _PyType_GetDict(type), n_members, n_unnamed_members) < 0) {
goto error;
}
@@ -675,7 +675,7 @@ _PyStructSequence_NewType(PyStructSequence_Desc *desc, unsigned long tp_flags)
}
if (initialize_structseq_dict(
- desc, type->tp_dict, n_members, n_unnamed_members) < 0) {
+ desc, _PyType_GetDict(type), n_members, n_unnamed_members) < 0) {
Py_DECREF(type);
return NULL;
}