Kaydet (Commit) 234e260d authored tarafından Guido van Rossum's avatar Guido van Rossum

Since PyDict_GetItem() can't raise an exception any more, there's no

need to call PyErr_Clear() when it returns NULL.
üst e23eb57f
......@@ -1287,10 +1287,8 @@ eval_code2(co, globals, locals,
}
x = PyDict_GetItem(x, w);
if (x == NULL) {
PyErr_Clear();
x = PyDict_GetItem(f->f_globals, w);
if (x == NULL) {
PyErr_Clear();
x = PyDict_GetItem(f->f_builtins, w);
if (x == NULL) {
PyErr_SetObject(
......@@ -1307,7 +1305,6 @@ eval_code2(co, globals, locals,
w = GETNAMEV(oparg);
x = PyDict_GetItem(f->f_globals, w);
if (x == NULL) {
PyErr_Clear();
x = PyDict_GetItem(f->f_builtins, w);
if (x == NULL) {
PyErr_SetObject(PyExc_NameError, w);
......
......@@ -3340,7 +3340,6 @@ optimize(c)
name = GETNAMEOBJ(oparg);
v = PyDict_GetItem(c->c_locals, name);
if (v == NULL) {
PyErr_Clear();
if (opcode == LOAD_NAME &&
(c->c_flags&CO_OPTIMIZED))
cur_instr[0] = LOAD_GLOBAL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment