summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-11-05 09:23:15 (GMT)
committerGitHub <noreply@github.com>2020-11-05 09:23:15 (GMT)
commit80449f243b13311d660eab3a751648029bcdd833 (patch)
treed1dcd63c3de31c148ff3b9faa25e3836a066fcbc /Python
parent178695b7aee7a7aacd49a3086060e06347d1e556 (diff)
downloadcpython-80449f243b13311d660eab3a751648029bcdd833.zip
cpython-80449f243b13311d660eab3a751648029bcdd833.tar.gz
cpython-80449f243b13311d660eab3a751648029bcdd833.tar.bz2
bpo-42266: Handle monkey-patching descriptors in LOAD_ATTR cache (GH-23157)
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 13b209f..32e3019 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;