From 053162dbcc41e0b6c139e29cd559e17e2a8bb174 Mon Sep 17 00:00:00 2001 From: Neil Schemenauer Date: Tue, 20 Oct 2020 12:15:40 -0700 Subject: [PATCH 1/3] Use Py_TYPE() rather than o->ob_type. --- Objects/unionobject.c | 2 +- Python/ceval.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Objects/unionobject.c b/Objects/unionobject.c index 89fdaf42560c1b..1b7f8ab51a4ce2 100644 --- a/Objects/unionobject.c +++ b/Objects/unionobject.c @@ -15,7 +15,7 @@ unionobject_dealloc(PyObject *self) unionobject *alias = (unionobject *)self; Py_XDECREF(alias->args); - self->ob_type->tp_free(self); + Py_TYPE(self)->tp_free(self); } static Py_hash_t diff --git a/Python/ceval.c b/Python/ceval.c index fafbf7524bb843..409710db9b49c2 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -3186,7 +3186,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) descr = _PyType_Lookup(type, name); if (descr == NULL || - descr->ob_type->tp_descr_get == NULL || + Py_TYPE(descr)->tp_descr_get == NULL || !PyDescr_IsData(descr)) { dictptr = (PyObject **) ((char *)owner + type->tp_dictoffset); From cc682eb5274b1a38310e1a1576824d5ad16abcf8 Mon Sep 17 00:00:00 2001 From: Neil Schemenauer Date: Tue, 20 Oct 2020 12:20:28 -0700 Subject: [PATCH 2/3] Add blurb. --- .../Core and Builtins/2020-10-20-12-20-24.bpo-42099.GKcRR6.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2020-10-20-12-20-24.bpo-42099.GKcRR6.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-10-20-12-20-24.bpo-42099.GKcRR6.rst b/Misc/NEWS.d/next/Core and Builtins/2020-10-20-12-20-24.bpo-42099.GKcRR6.rst new file mode 100644 index 00000000000000..a1e51e172035e9 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-10-20-12-20-24.bpo-42099.GKcRR6.rst @@ -0,0 +1 @@ +Replace references to ob_type with Py_TYPE() in unionobject and in ceval. From ac42c98d361dee36ea15c0fe506409f8306d97de Mon Sep 17 00:00:00 2001 From: Neil Schemenauer Date: Tue, 27 Oct 2020 10:45:25 -0700 Subject: [PATCH 3/3] Remove blurb, not useful piece of news. --- .../Core and Builtins/2020-10-20-12-20-24.bpo-42099.GKcRR6.rst | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Misc/NEWS.d/next/Core and Builtins/2020-10-20-12-20-24.bpo-42099.GKcRR6.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-10-20-12-20-24.bpo-42099.GKcRR6.rst b/Misc/NEWS.d/next/Core and Builtins/2020-10-20-12-20-24.bpo-42099.GKcRR6.rst deleted file mode 100644 index a1e51e172035e9..00000000000000 --- a/Misc/NEWS.d/next/Core and Builtins/2020-10-20-12-20-24.bpo-42099.GKcRR6.rst +++ /dev/null @@ -1 +0,0 @@ -Replace references to ob_type with Py_TYPE() in unionobject and in ceval.