Commit 25238c48 authored by Stefan Behnel's avatar Stefan Behnel

minor formatting fixes

parent b345988b
...@@ -103,24 +103,23 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, ...@@ -103,24 +103,23 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
/* Normalize to raise <class>, <instance> */ /* Normalize to raise <class>, <instance> */
value = type; value = type;
#if PY_VERSION_HEX < 0x02050000 #if PY_VERSION_HEX < 0x02050000
if (PyInstance_Check(type)) { if (PyInstance_Check(type)) {
type = (PyObject*) ((PyInstanceObject*)type)->in_class; type = (PyObject*) ((PyInstanceObject*)type)->in_class;
Py_INCREF(type);
}
else {
type = 0;
PyErr_SetString(PyExc_TypeError,
"raise: exception must be an old-style class or instance");
goto raise_error;
}
#else
type = (PyObject*) Py_TYPE(type);
Py_INCREF(type); Py_INCREF(type);
if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { } else {
PyErr_SetString(PyExc_TypeError, type = 0;
"raise: exception class must be a subclass of BaseException"); PyErr_SetString(PyExc_TypeError,
goto raise_error; "raise: exception must be an old-style class or instance");
} goto raise_error;
}
#else
type = (PyObject*) Py_TYPE(type);
Py_INCREF(type);
if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
PyErr_SetString(PyExc_TypeError,
"raise: exception class must be a subclass of BaseException");
goto raise_error;
}
#endif #endif
} }
...@@ -163,8 +162,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject ...@@ -163,8 +162,7 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
else if (PyTuple_Check(value)) { else if (PyTuple_Check(value)) {
Py_INCREF(value); Py_INCREF(value);
args = value; args = value;
} } else
else
args = PyTuple_Pack(1, value); args = PyTuple_Pack(1, value);
if (!args) if (!args)
goto bad; goto bad;
...@@ -199,12 +197,10 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject ...@@ -199,12 +197,10 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
fixed_cause = PyObject_CallObject(cause, NULL); fixed_cause = PyObject_CallObject(cause, NULL);
if (fixed_cause == NULL) if (fixed_cause == NULL)
goto bad; goto bad;
} } else if (PyExceptionInstance_Check(cause)) {
else if (PyExceptionInstance_Check(cause)) {
fixed_cause = cause; fixed_cause = cause;
Py_INCREF(fixed_cause); Py_INCREF(fixed_cause);
} } else {
else {
PyErr_SetString(PyExc_TypeError, PyErr_SetString(PyExc_TypeError,
"exception causes must derive from " "exception causes must derive from "
"BaseException"); "BaseException");
......
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