aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-11-05 09:23:15 +0000
committerGitHub <noreply@github.com>2020-11-05 09:23:15 +0000
commit80449f243b13311d660eab3a751648029bcdd833 (patch)
treed1dcd63c3de31c148ff3b9faa25e3836a066fcbc /Python/ceval.c
parentbpo-40816 Add AsyncContextDecorator class (GH-20516) (diff)
downloadcpython-80449f243b13311d660eab3a751648029bcdd833.tar.gz
cpython-80449f243b13311d660eab3a751648029bcdd833.tar.bz2
cpython-80449f243b13311d660eab3a751648029bcdd833.zip
bpo-42266: Handle monkey-patching descriptors in LOAD_ATTR cache (GH-23157)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 13b209fc706..32e3019682f 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3179,7 +3179,6 @@ main_loop:
if (co_opcache != NULL && /* co_opcache can be NULL after a DEOPT() call. */
type->tp_getattro == PyObject_GenericGetAttr)
{
- PyObject *descr;
Py_ssize_t ret;
if (type->tp_dictoffset > 0) {
@@ -3190,12 +3189,7 @@ main_loop:
goto error;
}
}
-
- descr = _PyType_Lookup(type, name);
- if (descr == NULL ||
- Py_TYPE(descr)->tp_descr_get == NULL ||
- !PyDescr_IsData(descr))
- {
+ if (_PyType_Lookup(type, name) == NULL) {
dictptr = (PyObject **) ((char *)owner + type->tp_dictoffset);
dict = *dictptr;