adjust braces a bit

This commit is contained in:
Benjamin Peterson 2011-10-19 16:57:40 -04:00
parent 34d38dce11
commit 9d9141f5db
1 changed files with 4 additions and 5 deletions

View File

@ -232,8 +232,9 @@ gen_throw(PyGenObject *gen, PyObject *args)
/* First, check the traceback argument, replacing None with /* First, check the traceback argument, replacing None with
NULL. */ NULL. */
if (tb == Py_None) if (tb == Py_None) {
tb = NULL; tb = NULL;
}
else if (tb != NULL && !PyTraceBack_Check(tb)) { else if (tb != NULL && !PyTraceBack_Check(tb)) {
PyErr_SetString(PyExc_TypeError, PyErr_SetString(PyExc_TypeError,
"throw() third argument must be a traceback object"); "throw() third argument must be a traceback object");
@ -244,9 +245,8 @@ gen_throw(PyGenObject *gen, PyObject *args)
Py_XINCREF(val); Py_XINCREF(val);
Py_XINCREF(tb); Py_XINCREF(tb);
if (PyExceptionClass_Check(typ)) { if (PyExceptionClass_Check(typ))
PyErr_NormalizeException(&typ, &val, &tb); PyErr_NormalizeException(&typ, &val, &tb);
}
else if (PyExceptionInstance_Check(typ)) { else if (PyExceptionInstance_Check(typ)) {
/* Raising an instance. The value should be a dummy. */ /* Raising an instance. The value should be a dummy. */
@ -262,12 +262,11 @@ gen_throw(PyGenObject *gen, PyObject *args)
typ = PyExceptionInstance_Class(typ); typ = PyExceptionInstance_Class(typ);
Py_INCREF(typ); Py_INCREF(typ);
if (tb == NULL) { if (tb == NULL)
/* Returns NULL if there's no traceback */ /* Returns NULL if there's no traceback */
tb = PyException_GetTraceback(val); tb = PyException_GetTraceback(val);
} }
} }
}
else { else {
/* Not something you can raise. throw() fails. */ /* Not something you can raise. throw() fails. */
PyErr_Format(PyExc_TypeError, PyErr_Format(PyExc_TypeError,