diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-05-09 14:46:46 +0000 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-05-09 14:46:46 +0000 |
commit | 7674841ef015b47767c7939c16a8ea1fe92ae340 (patch) | |
tree | 7d47cc565698109d01fd147dcbfa17c669f5aece /Objects/exceptions.c | |
parent | 976291be7875a1f83dcb64b9c936175fb1cefc8c (diff) | |
download | cpython-7674841ef015b47767c7939c16a8ea1fe92ae340.tar.gz |
Untabify C files. Will watch buildbots.
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r-- | Objects/exceptions.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c index a961143779..2e98283f85 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -217,7 +217,7 @@ BaseException_setstate(PyObject *self, PyObject *state) static PyMethodDef BaseException_methods[] = { {"__reduce__", (PyCFunction)BaseException_reduce, METH_NOARGS }, {"__setstate__", (PyCFunction)BaseException_setstate, METH_O }, -#ifdef Py_USING_UNICODE +#ifdef Py_USING_UNICODE {"__unicode__", (PyCFunction)BaseException_unicode, METH_NOARGS }, #endif {NULL, NULL, 0, NULL}, @@ -236,7 +236,7 @@ BaseException_getitem(PyBaseExceptionObject *self, Py_ssize_t index) static PyObject * BaseException_getslice(PyBaseExceptionObject *self, - Py_ssize_t start, Py_ssize_t stop) + Py_ssize_t start, Py_ssize_t stop) { if (PyErr_WarnPy3k("__getslice__ not supported for exception " "classes in 3.x; use args attribute", 1) < 0) @@ -316,7 +316,7 @@ static PyObject * BaseException_get_message(PyBaseExceptionObject *self) { PyObject *msg; - + /* if "message" is in self->dict, accessing a user-set message attribute */ if (self->dict && (msg = PyDict_GetItemString(self->dict, "message"))) { @@ -352,7 +352,7 @@ BaseException_set_message(PyBaseExceptionObject *self, PyObject *val) self->message = NULL; return 0; } - + /* else set it in __dict__, but may need to create the dict first */ if (self->dict == NULL) { self->dict = PyDict_New(); @@ -366,7 +366,7 @@ static PyGetSetDef BaseException_getset[] = { {"__dict__", (getter)BaseException_get_dict, (setter)BaseException_set_dict}, {"args", (getter)BaseException_get_args, (setter)BaseException_set_args}, {"message", (getter)BaseException_get_message, - (setter)BaseException_set_message}, + (setter)BaseException_set_message}, {NULL}, }; @@ -393,7 +393,7 @@ static PyTypeObject _PyExc_BaseException = { PyObject_GenericSetAttr, /*tp_setattro*/ 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC | - Py_TPFLAGS_BASE_EXC_SUBCLASS, /*tp_flags*/ + Py_TPFLAGS_BASE_EXC_SUBCLASS, /*tp_flags*/ PyDoc_STR("Common base class for all exceptions"), /* tp_doc */ (traverseproc)BaseException_traverse, /* tp_traverse */ (inquiry)BaseException_clear, /* tp_clear */ @@ -2186,25 +2186,25 @@ _PyExc_Init(void) PyExc_RecursionErrorInst = BaseException_new(&_PyExc_RuntimeError, NULL, NULL); if (!PyExc_RecursionErrorInst) - Py_FatalError("Cannot pre-allocate RuntimeError instance for " - "recursion errors"); + Py_FatalError("Cannot pre-allocate RuntimeError instance for " + "recursion errors"); else { - PyBaseExceptionObject *err_inst = - (PyBaseExceptionObject *)PyExc_RecursionErrorInst; - PyObject *args_tuple; - PyObject *exc_message; - exc_message = PyString_FromString("maximum recursion depth exceeded"); - if (!exc_message) - Py_FatalError("cannot allocate argument for RuntimeError " - "pre-allocation"); - args_tuple = PyTuple_Pack(1, exc_message); - if (!args_tuple) - Py_FatalError("cannot allocate tuple for RuntimeError " - "pre-allocation"); - Py_DECREF(exc_message); - if (BaseException_init(err_inst, args_tuple, NULL)) - Py_FatalError("init of pre-allocated RuntimeError failed"); - Py_DECREF(args_tuple); + PyBaseExceptionObject *err_inst = + (PyBaseExceptionObject *)PyExc_RecursionErrorInst; + PyObject *args_tuple; + PyObject *exc_message; + exc_message = PyString_FromString("maximum recursion depth exceeded"); + if (!exc_message) + Py_FatalError("cannot allocate argument for RuntimeError " + "pre-allocation"); + args_tuple = PyTuple_Pack(1, exc_message); + if (!args_tuple) + Py_FatalError("cannot allocate tuple for RuntimeError " + "pre-allocation"); + Py_DECREF(exc_message); + if (BaseException_init(err_inst, args_tuple, NULL)) + Py_FatalError("init of pre-allocated RuntimeError failed"); + Py_DECREF(args_tuple); } Py_DECREF(bltinmod); |