Skip to content

Commit 370bc2f

Browse files
committed
Code style fixup: No need for double ((parenthesis)) and use {} on an if else.
2 parents 27dc02e + 08d5ca6 commit 370bc2f

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Modules/arraymodule.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,7 +1522,7 @@ array_fromunicode(arrayobject *self, PyObject *args)
15221522
if (!PyArg_ParseTuple(args, "u#:fromunicode", &ustr, &n))
15231523
return NULL;
15241524
typecode = self->ob_descr->typecode;
1525-
if ((typecode != 'u')) {
1525+
if (typecode != 'u') {
15261526
PyErr_SetString(PyExc_ValueError,
15271527
"fromunicode() may only be called on "
15281528
"unicode type arrays");
@@ -1554,7 +1554,7 @@ array_tounicode(arrayobject *self, PyObject *unused)
15541554
{
15551555
char typecode;
15561556
typecode = self->ob_descr->typecode;
1557-
if ((typecode != 'u')) {
1557+
if (typecode != 'u') {
15581558
PyErr_SetString(PyExc_ValueError,
15591559
"tounicode() may only be called on unicode type arrays");
15601560
return NULL;
@@ -2174,10 +2174,11 @@ array_repr(arrayobject *a)
21742174
if (len == 0) {
21752175
return PyUnicode_FromFormat("array('%c')", (int)typecode);
21762176
}
2177-
if (typecode == 'u')
2177+
if (typecode == 'u') {
21782178
v = array_tounicode(a, NULL);
2179-
else
2179+
} else {
21802180
v = array_tolist(a, NULL);
2181+
}
21812182

21822183
s = PyUnicode_FromFormat("array('%c', %R)", (int)typecode, v);
21832184
Py_DECREF(v);

0 commit comments

Comments
 (0)