Index: Objects/bytesobject.c =================================================================== --- Objects/bytesobject.c (révision 66669) +++ Objects/bytesobject.c (copie de travail) @@ -818,7 +818,7 @@ /* Make sure both arguments are strings. */ if (!(PyBytes_Check(a) && PyBytes_Check(b))) { - if (Py_BytesWarningFlag && (op == Py_EQ) && + if (Py_BytesWarningFlag && (op == Py_EQ || op == Py_NE) && (PyObject_IsInstance((PyObject*)a, (PyObject*)&PyUnicode_Type) || PyObject_IsInstance((PyObject*)b, Index: Objects/bytearrayobject.c =================================================================== --- Objects/bytearrayobject.c (révision 66669) +++ Objects/bytearrayobject.c (copie de travail) @@ -939,7 +939,7 @@ error, even if the comparison is for equality. */ if (PyObject_IsInstance(self, (PyObject*)&PyUnicode_Type) || PyObject_IsInstance(other, (PyObject*)&PyUnicode_Type)) { - if (Py_BytesWarningFlag && op == Py_EQ) { + if (Py_BytesWarningFlag && (op == Py_EQ || op == Py_NE)) { if (PyErr_WarnEx(PyExc_BytesWarning, "Comparison between bytearray and string", 1)) return NULL;