summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2018-01-30 00:41:04 (GMT)
committerRaymond Hettinger <rhettinger@users.noreply.github.com>2018-01-30 00:41:04 (GMT)
commit332cd5ee4ff42c9904c56e68a1028f383f7fc9a8 (patch)
tree7e02c4a2919e9a8d17ed3be5008aa81d05dc14b1 /Python/ceval.c
parentb6e43af669f61a37a29d8ff0785455108e6bc29d (diff)
downloadcpython-332cd5ee4ff42c9904c56e68a1028f383f7fc9a8.zip
cpython-332cd5ee4ff42c9904c56e68a1028f383f7fc9a8.tar.gz
cpython-332cd5ee4ff42c9904c56e68a1028f383f7fc9a8.tar.bz2
bpo-32550. Remove the STORE_ANNOTATION bytecode. (GH-5181)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c55
1 files changed, 0 insertions, 55 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 52a42b0..af5eb99 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1574,61 +1574,6 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
DISPATCH();
}
- TARGET(STORE_ANNOTATION) {
- _Py_IDENTIFIER(__annotations__);
- PyObject *ann_dict;
- PyObject *ann = POP();
- PyObject *name = GETITEM(names, oparg);
- int err;
- if (f->f_locals == NULL) {
- PyErr_Format(PyExc_SystemError,
- "no locals found when storing annotation");
- Py_DECREF(ann);
- goto error;
- }
- /* first try to get __annotations__ from locals... */
- if (PyDict_CheckExact(f->f_locals)) {
- ann_dict = _PyDict_GetItemId(f->f_locals,
- &PyId___annotations__);
- if (ann_dict == NULL) {
- PyErr_SetString(PyExc_NameError,
- "__annotations__ not found");
- Py_DECREF(ann);
- goto error;
- }
- Py_INCREF(ann_dict);
- }
- else {
- PyObject *ann_str = _PyUnicode_FromId(&PyId___annotations__);
- if (ann_str == NULL) {
- Py_DECREF(ann);
- goto error;
- }
- ann_dict = PyObject_GetItem(f->f_locals, ann_str);
- if (ann_dict == NULL) {
- if (PyErr_ExceptionMatches(PyExc_KeyError)) {
- PyErr_SetString(PyExc_NameError,
- "__annotations__ not found");
- }
- Py_DECREF(ann);
- goto error;
- }
- }
- /* ...if succeeded, __annotations__[name] = ann */
- if (PyDict_CheckExact(ann_dict)) {
- err = PyDict_SetItem(ann_dict, name, ann);
- }
- else {
- err = PyObject_SetItem(ann_dict, name, ann);
- }
- Py_DECREF(ann_dict);
- Py_DECREF(ann);
- if (err != 0) {
- goto error;
- }
- DISPATCH();
- }
-
TARGET(DELETE_SUBSCR) {
PyObject *sub = TOP();
PyObject *container = SECOND();