aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-05-12 01:43:38 +0200
committerGitHub <noreply@github.com>2020-05-12 01:43:38 +0200
commit4804b5b3df82e7892ca0550b02f902bcfc16bb48 (patch)
treea5c199a893d417fcce434e4412373e9a3ecd557f /Python/ceval.c
parentbpo-40334: produce specialized errors for invalid del targets (GH-19911) (diff)
downloadcpython-4804b5b3df82e7892ca0550b02f902bcfc16bb48.tar.gz
cpython-4804b5b3df82e7892ca0550b02f902bcfc16bb48.tar.bz2
cpython-4804b5b3df82e7892ca0550b02f902bcfc16bb48.zip
bpo-39465: Don't access directly _Py_Identifier members (GH-20043)
* Replace id->object with _PyUnicode_FromId(&id) * Use _Py_static_string_init(str) macro to initialize statically name_op in typeobject.c.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 6435bd0544..e54e344a5f 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4414,7 +4414,7 @@ special_lookup(PyThreadState *tstate, PyObject *o, _Py_Identifier *id)
PyObject *res;
res = _PyObject_LookupSpecial(o, id);
if (res == NULL && !_PyErr_Occurred(tstate)) {
- _PyErr_SetObject(tstate, PyExc_AttributeError, id->object);
+ _PyErr_SetObject(tstate, PyExc_AttributeError, _PyUnicode_FromId(id));
return NULL;
}
return res;