Commit 9504b131 authored by Gregory P. Smith's avatar Gregory P. Smith

Code style fixup: No need for double ((parenthesis)) and use {} on an if else.

parent a6be61ec
...@@ -1461,7 +1461,7 @@ array_fromunicode(arrayobject *self, PyObject *args) ...@@ -1461,7 +1461,7 @@ array_fromunicode(arrayobject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "u#:fromunicode", &ustr, &n)) if (!PyArg_ParseTuple(args, "u#:fromunicode", &ustr, &n))
return NULL; return NULL;
typecode = self->ob_descr->typecode; typecode = self->ob_descr->typecode;
if ((typecode != 'u')) { if (typecode != 'u') {
PyErr_SetString(PyExc_ValueError, PyErr_SetString(PyExc_ValueError,
"fromunicode() may only be called on " "fromunicode() may only be called on "
"unicode type arrays"); "unicode type arrays");
...@@ -1493,7 +1493,7 @@ array_tounicode(arrayobject *self, PyObject *unused) ...@@ -1493,7 +1493,7 @@ array_tounicode(arrayobject *self, PyObject *unused)
{ {
Py_UNICODE typecode; Py_UNICODE typecode;
typecode = self->ob_descr->typecode; typecode = self->ob_descr->typecode;
if ((typecode != 'u')) { if (typecode != 'u') {
PyErr_SetString(PyExc_ValueError, PyErr_SetString(PyExc_ValueError,
"tounicode() may only be called on unicode type arrays"); "tounicode() may only be called on unicode type arrays");
return NULL; return NULL;
...@@ -2107,10 +2107,11 @@ array_repr(arrayobject *a) ...@@ -2107,10 +2107,11 @@ array_repr(arrayobject *a)
if (len == 0) { if (len == 0) {
return PyUnicode_FromFormat("array('%c')", (int)typecode); return PyUnicode_FromFormat("array('%c')", (int)typecode);
} }
if ((typecode == 'u')) if (typecode == 'u') {
v = array_tounicode(a, NULL); v = array_tounicode(a, NULL);
else } else {
v = array_tolist(a, NULL); v = array_tolist(a, NULL);
}
s = PyUnicode_FromFormat("array('%c', %R)", (int)typecode, v); s = PyUnicode_FromFormat("array('%c', %R)", (int)typecode, v);
Py_DECREF(v); Py_DECREF(v);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment