summaryrefslogtreecommitdiff
path: root/Objects/bytesobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/bytesobject.c')
-rw-r--r--Objects/bytesobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index c7fe751562..da2e23f1f6 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -964,8 +964,8 @@ bytes_richcompare(PyObject *self, PyObject *other, int op)
error, even if the comparison is for equality. */
if (PyObject_IsInstance(self, (PyObject*)&PyUnicode_Type) ||
PyObject_IsInstance(other, (PyObject*)&PyUnicode_Type)) {
- PyErr_SetString(PyExc_TypeError, "can't compare bytes and str");
- return NULL;
+ Py_INCREF(Py_NotImplemented);
+ return Py_NotImplemented;
}
self_size = _getbuffer(self, &self_bytes);