[Python-checkins] cpython (merge 3.3 -> default): Code style fixup: No need for double ((parenthesis)) and use {} on an if else.
gregory.p.smith
python-checkins at python.org
Tue Dec 11 05:23:03 CET 2012
http://hg.python.org/cpython/rev/bc322469a7a8
changeset: 80827:bc322469a7a8
parent: 80824:a1768761358a
parent: 80826:757cc49ced54
user: Gregory P. Smith <greg at krypto.org>
date: Mon Dec 10 20:22:55 2012 -0800
summary:
Code style fixup: No need for double ((parenthesis)) and use {} on an if else.
files:
Modules/arraymodule.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -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;
@@ -2174,10 +2174,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);
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list