summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2007-09-19 21:56:32 (GMT)
committerThomas Wouters <thomas@python.org>2007-09-19 21:56:32 (GMT)
commit7ce29ca41cd2c41ac7a5981d182f8db25c2af977 (patch)
treeeb7dd5248547a562ad8c518641e98a0d887723ea /Python
parentce272b6f8ac8997a4ff381e8804cddae8a6125c0 (diff)
downloadcpython-7ce29ca41cd2c41ac7a5981d182f8db25c2af977.zip
cpython-7ce29ca41cd2c41ac7a5981d182f8db25c2af977.tar.gz
cpython-7ce29ca41cd2c41ac7a5981d182f8db25c2af977.tar.bz2
Whitespace cleanup.
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c77
1 files changed, 39 insertions, 38 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 07e4013..73a0624 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1467,8 +1467,8 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
case RAISE_VARARGS:
v = w = NULL;
switch (oparg) {
- case 2:
- v = POP(); /* cause */
+ case 2:
+ v = POP(); /* cause */
case 1:
w = POP(); /* exc */
case 0: /* Fallthrough */
@@ -2876,7 +2876,7 @@ set_exc_info(PyThreadState *tstate,
tstate->exc_type = type;
tstate->exc_value = value;
tstate->exc_traceback = tb;
- PyException_SetTraceback(value, tb);
+ PyException_SetTraceback(value, tb);
Py_XDECREF(tmp_type);
Py_XDECREF(tmp_value);
Py_XDECREF(tmp_tb);
@@ -2927,7 +2927,7 @@ reset_exc_info(PyThreadState *tstate)
static enum why_code
do_raise(PyObject *exc, PyObject *cause)
{
- PyObject *type = NULL, *value = NULL, *tb = NULL;
+ PyObject *type = NULL, *value = NULL, *tb = NULL;
if (exc == NULL) {
/* Reraise */
@@ -2935,16 +2935,16 @@ do_raise(PyObject *exc, PyObject *cause)
type = tstate->exc_type;
value = tstate->exc_value;
tb = tstate->exc_traceback;
- if (type == Py_None) {
- PyErr_SetString(PyExc_RuntimeError,
- "No active exception to reraise");
- return WHY_EXCEPTION;
- }
- Py_XINCREF(type);
+ if (type == Py_None) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "No active exception to reraise");
+ return WHY_EXCEPTION;
+ }
+ Py_XINCREF(type);
Py_XINCREF(value);
Py_XINCREF(tb);
- PyErr_Restore(type, value, tb);
- return WHY_RERAISE;
+ PyErr_Restore(type, value, tb);
+ return WHY_RERAISE;
}
/* We support the following forms of raise:
@@ -2953,11 +2953,11 @@ do_raise(PyObject *exc, PyObject *cause)
raise <type> */
if (PyExceptionClass_Check(exc)) {
- type = exc;
- value = PyObject_CallObject(exc, NULL);
+ type = exc;
+ value = PyObject_CallObject(exc, NULL);
if (value == NULL)
- goto raise_error;
- }
+ goto raise_error;
+ }
else if (PyExceptionInstance_Check(exc)) {
value = exc;
type = PyExceptionInstance_Class(exc);
@@ -2966,31 +2966,32 @@ do_raise(PyObject *exc, PyObject *cause)
else {
/* Not something you can raise. You get an exception
anyway, just not what you specified :-) */
- Py_DECREF(exc);
+ Py_DECREF(exc);
PyErr_SetString(PyExc_TypeError,
- "exceptions must derive from BaseException");
+ "exceptions must derive from BaseException");
goto raise_error;
}
- tb = PyException_GetTraceback(value);
- if (cause) {
- PyObject *fixed_cause;
- if (PyExceptionClass_Check(cause)) {
- fixed_cause = PyObject_CallObject(cause, NULL);
- if (fixed_cause == NULL)
- goto raise_error;
- Py_DECREF(cause);
- }
- else if (PyExceptionInstance_Check(cause)) {
- fixed_cause = cause;
- }
- else {
- PyErr_SetString(PyExc_TypeError,
- "exception causes must derive from BaseException");
- goto raise_error;
- }
- PyException_SetCause(value, fixed_cause);
- }
+ tb = PyException_GetTraceback(value);
+ if (cause) {
+ PyObject *fixed_cause;
+ if (PyExceptionClass_Check(cause)) {
+ fixed_cause = PyObject_CallObject(cause, NULL);
+ if (fixed_cause == NULL)
+ goto raise_error;
+ Py_DECREF(cause);
+ }
+ else if (PyExceptionInstance_Check(cause)) {
+ fixed_cause = cause;
+ }
+ else {
+ PyErr_SetString(PyExc_TypeError,
+ "exception causes must derive from "
+ "BaseException");
+ goto raise_error;
+ }
+ PyException_SetCause(value, fixed_cause);
+ }
PyErr_Restore(type, value, tb);
return WHY_EXCEPTION;
@@ -3675,7 +3676,7 @@ do_call(PyObject *func, PyObject ***pp_stack, int na, int nk)
PCALL(PCALL_OTHER);
#endif
result = PyObject_Call(func, callargs, kwdict);
- call_fail:
+call_fail:
Py_XDECREF(callargs);
Py_XDECREF(kwdict);
return result;