diff options
author | Benjamin Peterson <benjamin@python.org> | 2013-11-14 04:25:01 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2013-11-14 04:25:01 (GMT) |
commit | 079c9988729dfe67c657718593a0ae66f6d45b1e (patch) | |
tree | 350292c1216df59d6b36f3a705b37afc6c59f088 | |
parent | 8ff3e8af72813614be90a4c1c47ed1e9fffbb295 (diff) | |
download | cpython-079c9988729dfe67c657718593a0ae66f6d45b1e.zip cpython-079c9988729dfe67c657718593a0ae66f6d45b1e.tar.gz cpython-079c9988729dfe67c657718593a0ae66f6d45b1e.tar.bz2 |
adjust style
-rw-r--r-- | Objects/exceptions.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 94f581b..53dab62 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -2633,13 +2633,12 @@ _PyErr_TrySetFromCause(const char *format, ...) va_list vargs; PyErr_Fetch(&exc, &val, &tb); - caught_type = (PyTypeObject *) exc; + caught_type = (PyTypeObject *)exc; /* Ensure type info indicates no extra state is stored at the C level */ - if (caught_type->tp_init != (initproc) BaseException_init || + if (caught_type->tp_init != (initproc)BaseException_init || caught_type->tp_new != BaseException_new || caught_type->tp_basicsize != _PyExc_BaseException.tp_basicsize || - caught_type->tp_itemsize != _PyExc_BaseException.tp_itemsize - ) { + caught_type->tp_itemsize != _PyExc_BaseException.tp_itemsize) { /* We can't be sure we can wrap this safely, since it may contain * more state than just the exception type. Accordingly, we just * leave it alone. @@ -2650,13 +2649,11 @@ _PyErr_TrySetFromCause(const char *format, ...) /* Check the args are empty or contain a single string */ PyErr_NormalizeException(&exc, &val, &tb); - instance_args = ((PyBaseExceptionObject *) val)->args; + instance_args = ((PyBaseExceptionObject *)val)->args; num_args = PyTuple_GET_SIZE(instance_args); - if ((num_args > 1) || + if (num_args > 1 || (num_args == 1 && - !PyUnicode_CheckExact(PyTuple_GET_ITEM(instance_args, 0)) - ) - ) { + !PyUnicode_CheckExact(PyTuple_GET_ITEM(instance_args, 0)))) { /* More than 1 arg, or the one arg we do have isn't a string */ PyErr_Restore(exc, val, tb); @@ -2665,9 +2662,8 @@ _PyErr_TrySetFromCause(const char *format, ...) /* Ensure the instance dict is also empty */ dictptr = _PyObject_GetDictPtr(val); - if ((dictptr != NULL) && (*dictptr != NULL) && - (PyObject_Length(*dictptr) > 0) - ) { + if (dictptr != NULL && *dictptr != NULL && + PyObject_Length(*dictptr) > 0) { /* While we could potentially copy a non-empty instance dictionary * to the replacement exception, for now we take the more * conservative path of leaving exceptions with attributes set |