diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index 744e6a9ef25..1442c727323 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -1459,10 +1459,7 @@ bytes_translate(PyByteArrayObject *self, PyObject *args) Py_LOCAL(PyByteArrayObject *) return_self(PyByteArrayObject *self) { - if (PyByteArray_CheckExact(self)) { - Py_INCREF(self); - return (PyByteArrayObject *)self; - } + /* always return a new bytearray */ return (PyByteArrayObject *)PyByteArray_FromStringAndSize( PyByteArray_AS_STRING(self), PyByteArray_GET_SIZE(self));