Commits

Alexander Belopolsky committed f17f67f

Issue #15973: fixed 3.2 backport.

  • Participants
  • Parent commits c99cf18
  • Branches 3.2

Comments (0)

Files changed (1)

File Modules/_datetimemodule.c

 timezone_richcompare(PyDateTime_TimeZone *self,
                      PyDateTime_TimeZone *other, int op)
 {
-    if (op != Py_EQ && op != Py_NE)
-        Py_RETURN_NOTIMPLEMENTED;
+    if (op != Py_EQ && op != Py_NE) {
+        Py_INCREF(Py_NotImplemented);
+        return Py_NotImplemented;
+    }
     if (Py_TYPE(other) != &PyDateTime_TimeZoneType) {
 	if (op == Py_EQ)
 	    Py_RETURN_FALSE;