[Python-3000-checkins] r58214 - python/branches/py3k/Python/ceval.c

thomas.wouters python-3000-checkins at python.org
Wed Sep 19 23:56:33 CEST 2007


Author: thomas.wouters
Date: Wed Sep 19 23:56:32 2007
New Revision: 58214

Modified:
   python/branches/py3k/Python/ceval.c
Log:

Whitespace cleanup.



Modified: python/branches/py3k/Python/ceval.c
==============================================================================
--- python/branches/py3k/Python/ceval.c	(original)
+++ python/branches/py3k/Python/ceval.c	Wed Sep 19 23:56:32 2007
@@ -1467,8 +1467,8 @@
 		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 @@
 	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 @@
 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 @@
 		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 @@
        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 @@
 	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 @@
 		PCALL(PCALL_OTHER);
 #endif
 	result = PyObject_Call(func, callargs, kwdict);
- call_fail:
+call_fail:
 	Py_XDECREF(callargs);
 	Py_XDECREF(kwdict);
 	return result;


More information about the Python-3000-checkins mailing list