Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7ce29ca

Browse files
committed
Whitespace cleanup.
1 parent ce272b6 commit 7ce29ca

1 file changed

Lines changed: 39 additions & 38 deletions

File tree

Python/ceval.c

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,8 +1467,8 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
14671467
case RAISE_VARARGS:
14681468
v = w = NULL;
14691469
switch (oparg) {
1470-
case 2:
1471-
v = POP(); /* cause */
1470+
case 2:
1471+
v = POP(); /* cause */
14721472
case 1:
14731473
w = POP(); /* exc */
14741474
case 0: /* Fallthrough */
@@ -2876,7 +2876,7 @@ set_exc_info(PyThreadState *tstate,
28762876
tstate->exc_type = type;
28772877
tstate->exc_value = value;
28782878
tstate->exc_traceback = tb;
2879-
PyException_SetTraceback(value, tb);
2879+
PyException_SetTraceback(value, tb);
28802880
Py_XDECREF(tmp_type);
28812881
Py_XDECREF(tmp_value);
28822882
Py_XDECREF(tmp_tb);
@@ -2927,24 +2927,24 @@ reset_exc_info(PyThreadState *tstate)
29272927
static enum why_code
29282928
do_raise(PyObject *exc, PyObject *cause)
29292929
{
2930-
PyObject *type = NULL, *value = NULL, *tb = NULL;
2930+
PyObject *type = NULL, *value = NULL, *tb = NULL;
29312931

29322932
if (exc == NULL) {
29332933
/* Reraise */
29342934
PyThreadState *tstate = PyThreadState_GET();
29352935
type = tstate->exc_type;
29362936
value = tstate->exc_value;
29372937
tb = tstate->exc_traceback;
2938-
if (type == Py_None) {
2939-
PyErr_SetString(PyExc_RuntimeError,
2940-
"No active exception to reraise");
2941-
return WHY_EXCEPTION;
2942-
}
2943-
Py_XINCREF(type);
2938+
if (type == Py_None) {
2939+
PyErr_SetString(PyExc_RuntimeError,
2940+
"No active exception to reraise");
2941+
return WHY_EXCEPTION;
2942+
}
2943+
Py_XINCREF(type);
29442944
Py_XINCREF(value);
29452945
Py_XINCREF(tb);
2946-
PyErr_Restore(type, value, tb);
2947-
return WHY_RERAISE;
2946+
PyErr_Restore(type, value, tb);
2947+
return WHY_RERAISE;
29482948
}
29492949

29502950
/* We support the following forms of raise:
@@ -2953,11 +2953,11 @@ do_raise(PyObject *exc, PyObject *cause)
29532953
raise <type> */
29542954

29552955
if (PyExceptionClass_Check(exc)) {
2956-
type = exc;
2957-
value = PyObject_CallObject(exc, NULL);
2956+
type = exc;
2957+
value = PyObject_CallObject(exc, NULL);
29582958
if (value == NULL)
2959-
goto raise_error;
2960-
}
2959+
goto raise_error;
2960+
}
29612961
else if (PyExceptionInstance_Check(exc)) {
29622962
value = exc;
29632963
type = PyExceptionInstance_Class(exc);
@@ -2966,31 +2966,32 @@ do_raise(PyObject *exc, PyObject *cause)
29662966
else {
29672967
/* Not something you can raise. You get an exception
29682968
anyway, just not what you specified :-) */
2969-
Py_DECREF(exc);
2969+
Py_DECREF(exc);
29702970
PyErr_SetString(PyExc_TypeError,
2971-
"exceptions must derive from BaseException");
2971+
"exceptions must derive from BaseException");
29722972
goto raise_error;
29732973
}
29742974

2975-
tb = PyException_GetTraceback(value);
2976-
if (cause) {
2977-
PyObject *fixed_cause;
2978-
if (PyExceptionClass_Check(cause)) {
2979-
fixed_cause = PyObject_CallObject(cause, NULL);
2980-
if (fixed_cause == NULL)
2981-
goto raise_error;
2982-
Py_DECREF(cause);
2983-
}
2984-
else if (PyExceptionInstance_Check(cause)) {
2985-
fixed_cause = cause;
2986-
}
2987-
else {
2988-
PyErr_SetString(PyExc_TypeError,
2989-
"exception causes must derive from BaseException");
2990-
goto raise_error;
2991-
}
2992-
PyException_SetCause(value, fixed_cause);
2993-
}
2975+
tb = PyException_GetTraceback(value);
2976+
if (cause) {
2977+
PyObject *fixed_cause;
2978+
if (PyExceptionClass_Check(cause)) {
2979+
fixed_cause = PyObject_CallObject(cause, NULL);
2980+
if (fixed_cause == NULL)
2981+
goto raise_error;
2982+
Py_DECREF(cause);
2983+
}
2984+
else if (PyExceptionInstance_Check(cause)) {
2985+
fixed_cause = cause;
2986+
}
2987+
else {
2988+
PyErr_SetString(PyExc_TypeError,
2989+
"exception causes must derive from "
2990+
"BaseException");
2991+
goto raise_error;
2992+
}
2993+
PyException_SetCause(value, fixed_cause);
2994+
}
29942995

29952996
PyErr_Restore(type, value, tb);
29962997
return WHY_EXCEPTION;
@@ -3675,7 +3676,7 @@ do_call(PyObject *func, PyObject ***pp_stack, int na, int nk)
36753676
PCALL(PCALL_OTHER);
36763677
#endif
36773678
result = PyObject_Call(func, callargs, kwdict);
3678-
call_fail:
3679+
call_fail:
36793680
Py_XDECREF(callargs);
36803681
Py_XDECREF(kwdict);
36813682
return result;

0 commit comments

Comments
 (0)