summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/bytearrayobject.c11
-rw-r--r--Objects/bytesobject.c3
2 files changed, 8 insertions, 6 deletions
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
index 9d32965..4e2bb60 100644
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -999,12 +999,13 @@ bytearray_repr(PyByteArrayObject *self)
static PyObject *
bytearray_str(PyObject *op)
{
- if (Py_BytesWarningFlag) {
- if (PyErr_WarnEx(PyExc_BytesWarning,
- "str() on a bytearray instance", 1))
- return NULL;
+ if (Py_BytesWarningFlag) {
+ if (PyErr_WarnEx(PyExc_BytesWarning,
+ "str() on a bytearray instance", 1)) {
+ return NULL;
}
- return bytearray_repr((PyByteArrayObject*)op);
+ }
+ return bytearray_repr((PyByteArrayObject*)op);
}
static PyObject *
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index 943c329..648b2a5 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -1416,8 +1416,9 @@ bytes_str(PyObject *op)
{
if (Py_BytesWarningFlag) {
if (PyErr_WarnEx(PyExc_BytesWarning,
- "str() on a bytes instance", 1))
+ "str() on a bytes instance", 1)) {
return NULL;
+ }
}
return bytes_repr(op);
}