Mercurial > cpython-lru_cache-weakref
diff Modules/arraymodule.c @ 80826:757cc49ced54 3.3
Code style fixup: No need for double ((parenthesis)) and use {} on an if else.
| author | Gregory P. Smith <greg@krypto.org> |
|---|---|
| date | Mon, 10 Dec 2012 20:22:31 -0800 |
| parents | 152d85b2da3a 88dcccb46298 |
| children | 3ca72d4e9762 bc322469a7a8 |
line wrap: on
line diff
--- a/Modules/arraymodule.c Mon Dec 10 18:34:29 2012 -0800 +++ b/Modules/arraymodule.c Mon Dec 10 20:22:31 2012 -0800 @@ -1522,7 +1522,7 @@ if (!PyArg_ParseTuple(args, "u#:fromunicode", &ustr, &n)) return NULL; typecode = self->ob_descr->typecode; - if ((typecode != 'u')) { + if (typecode != 'u') { PyErr_SetString(PyExc_ValueError, "fromunicode() may only be called on " "unicode type arrays"); @@ -1554,7 +1554,7 @@ { char typecode; typecode = self->ob_descr->typecode; - if ((typecode != 'u')) { + if (typecode != 'u') { PyErr_SetString(PyExc_ValueError, "tounicode() may only be called on unicode type arrays"); return NULL; @@ -2177,10 +2177,11 @@ if (len == 0) { return PyUnicode_FromFormat("array('%c')", (int)typecode); } - if (typecode == 'u') + if (typecode == 'u') { v = array_tounicode(a, NULL); - else + } else { v = array_tolist(a, NULL); + } s = PyUnicode_FromFormat("array('%c', %R)", (int)typecode, v); Py_DECREF(v);
