summaryrefslogtreecommitdiffstats
path: root/Modules/arraymodule.c
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2012-12-11 04:20:20 (GMT)
committerGregory P. Smith <greg@krypto.org>2012-12-11 04:20:20 (GMT)
commit9504b131457e1e3fc10dace6ffcb22b00f3a0077 (patch)
treeace85f011353aa1386c6e2f74238c8ec745e2fac /Modules/arraymodule.c
parenta6be61ec71be600e1d270aea17f1d90dccf6088b (diff)
downloadcpython-9504b131457e1e3fc10dace6ffcb22b00f3a0077.zip
cpython-9504b131457e1e3fc10dace6ffcb22b00f3a0077.tar.gz
cpython-9504b131457e1e3fc10dace6ffcb22b00f3a0077.tar.bz2
Code style fixup: No need for double ((parenthesis)) and use {} on an if else.
Diffstat (limited to 'Modules/arraymodule.c')
-rw-r--r--Modules/arraymodule.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 2d4ee72..475acb4 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -1461,7 +1461,7 @@ array_fromunicode(arrayobject *self, PyObject *args)
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");
@@ -1493,7 +1493,7 @@ array_tounicode(arrayobject *self, PyObject *unused)
{
Py_UNICODE 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;
@@ -2107,10 +2107,11 @@ array_repr(arrayobject *a)
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);