summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGregory P. Smith <greg@krypto.org>2012-12-11 04:22:55 (GMT)
committerGregory P. Smith <greg@krypto.org>2012-12-11 04:22:55 (GMT)
commit370bc2f7ee3e5373138038327b2f68f93a25f9d2 (patch)
treef9f91e795646d185bb5b6dfdbfd17e393cd54990 /Modules
parent27dc02e8c5b8e0d8355b6a12d3121891604f2e7d (diff)
parent08d5ca6cd4a30e2f6a8df48fb9231a5321f72efc (diff)
downloadcpython-370bc2f7ee3e5373138038327b2f68f93a25f9d2.zip
cpython-370bc2f7ee3e5373138038327b2f68f93a25f9d2.tar.gz
cpython-370bc2f7ee3e5373138038327b2f68f93a25f9d2.tar.bz2
Code style fixup: No need for double ((parenthesis)) and use {} on an if else.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/arraymodule.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 4d4c2ae..fd6580d 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -1522,7 +1522,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");
@@ -1554,7 +1554,7 @@ array_tounicode(arrayobject *self, PyObject *unused)
{
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;
@@ -2174,10 +2174,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);