move more variable declarations to the top of blocks

This commit is contained in:
Benjamin Peterson 2012-10-12 11:40:01 -04:00
parent f208df3618
commit fe1bcb64cd
1 changed files with 4 additions and 3 deletions

View File

@ -1834,13 +1834,14 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
TARGET(PRINT_EXPR) { TARGET(PRINT_EXPR) {
PyObject *value = POP(); PyObject *value = POP();
PyObject *hook = PySys_GetObject("displayhook"); PyObject *hook = PySys_GetObject("displayhook");
PyObject *res;
if (hook == NULL) { if (hook == NULL) {
PyErr_SetString(PyExc_RuntimeError, PyErr_SetString(PyExc_RuntimeError,
"lost sys.displayhook"); "lost sys.displayhook");
Py_DECREF(value); Py_DECREF(value);
goto error; goto error;
} }
PyObject *res = PyObject_CallFunctionObjArgs(hook, value, NULL); res = PyObject_CallFunctionObjArgs(hook, value, NULL);
Py_DECREF(value); Py_DECREF(value);
if (res == NULL) if (res == NULL)
goto error; goto error;
@ -2394,7 +2395,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
_Py_IDENTIFIER(__import__); _Py_IDENTIFIER(__import__);
PyObject *name = GETITEM(names, oparg); PyObject *name = GETITEM(names, oparg);
PyObject *func = _PyDict_GetItemId(f->f_builtins, &PyId___import__); PyObject *func = _PyDict_GetItemId(f->f_builtins, &PyId___import__);
PyObject *from, *level, *args; PyObject *from, *level, *args, *res;
if (func == NULL) { if (func == NULL) {
PyErr_SetString(PyExc_ImportError, PyErr_SetString(PyExc_ImportError,
"__import__ not found"); "__import__ not found");
@ -2426,7 +2427,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
goto error; goto error;
} }
READ_TIMESTAMP(intr0); READ_TIMESTAMP(intr0);
PyObject *res = PyEval_CallObject(func, args); res = PyEval_CallObject(func, args);
READ_TIMESTAMP(intr1); READ_TIMESTAMP(intr1);
Py_DECREF(args); Py_DECREF(args);
Py_DECREF(func); Py_DECREF(func);