Issue #23681: The -b option now affects comparisons of bytes with int.
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index e0ac1ab..5a9dfbd 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -1385,14 +1385,23 @@
 
     /* Make sure both arguments are strings. */
     if (!(PyBytes_Check(a) && PyBytes_Check(b))) {
-        if (Py_BytesWarningFlag && (op == Py_EQ || op == Py_NE) &&
-            (PyObject_IsInstance((PyObject*)a,
-                                 (PyObject*)&PyUnicode_Type) ||
-            PyObject_IsInstance((PyObject*)b,
-                                 (PyObject*)&PyUnicode_Type))) {
-            if (PyErr_WarnEx(PyExc_BytesWarning,
-                        "Comparison between bytes and string", 1))
-                return NULL;
+        if (Py_BytesWarningFlag && (op == Py_EQ || op == Py_NE)) {
+            if (PyObject_IsInstance((PyObject*)a,
+                                    (PyObject*)&PyUnicode_Type) ||
+                PyObject_IsInstance((PyObject*)b,
+                                    (PyObject*)&PyUnicode_Type)) {
+                if (PyErr_WarnEx(PyExc_BytesWarning,
+                            "Comparison between bytes and string", 1))
+                    return NULL;
+            }
+            else if (PyObject_IsInstance((PyObject*)a,
+                                    (PyObject*)&PyLong_Type) ||
+                PyObject_IsInstance((PyObject*)b,
+                                    (PyObject*)&PyLong_Type)) {
+                if (PyErr_WarnEx(PyExc_BytesWarning,
+                            "Comparison between bytes and int", 1))
+                    return NULL;
+            }
         }
         result = Py_NotImplemented;
     }