summaryrefslogtreecommitdiffstats
path: root/Objects/genobject.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-10-19 20:58:15 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-10-19 20:58:15 (GMT)
commitdc37ce95e8979d5d9e9c0777910bf94080d29115 (patch)
treeb3c024b4ce9dfcab8fd4202849328208e1c027c4 /Objects/genobject.c
parentbecd56822ac62ba2ddb4956e84f6854366945617 (diff)
parent9d9141f5db7e7386f8f6480c03d4548dea2182fa (diff)
downloadcpython-dc37ce95e8979d5d9e9c0777910bf94080d29115.zip
cpython-dc37ce95e8979d5d9e9c0777910bf94080d29115.tar.gz
cpython-dc37ce95e8979d5d9e9c0777910bf94080d29115.tar.bz2
merge 3.2
Diffstat (limited to 'Objects/genobject.c')
-rw-r--r--Objects/genobject.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index b7765ef..c6612e2 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -232,8 +232,9 @@ gen_throw(PyGenObject *gen, PyObject *args)
/* First, check the traceback argument, replacing None with
NULL. */
- if (tb == Py_None)
+ if (tb == Py_None) {
tb = NULL;
+ }
else if (tb != NULL && !PyTraceBack_Check(tb)) {
PyErr_SetString(PyExc_TypeError,
"throw() third argument must be a traceback object");
@@ -244,9 +245,8 @@ gen_throw(PyGenObject *gen, PyObject *args)
Py_XINCREF(val);
Py_XINCREF(tb);
- if (PyExceptionClass_Check(typ)) {
+ if (PyExceptionClass_Check(typ))
PyErr_NormalizeException(&typ, &val, &tb);
- }
else if (PyExceptionInstance_Check(typ)) {
/* Raising an instance. The value should be a dummy. */
@@ -262,10 +262,9 @@ gen_throw(PyGenObject *gen, PyObject *args)
typ = PyExceptionInstance_Class(typ);
Py_INCREF(typ);
- if (tb == NULL) {
+ if (tb == NULL)
/* Returns NULL if there's no traceback */
tb = PyException_GetTraceback(val);
- }
}
}
else {