]> granicus.if.org Git - python/commitdiff
Issue #15973: fixed 3.2 backport.
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>
Thu, 20 Sep 2012 21:23:46 +0000 (17:23 -0400)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>
Thu, 20 Sep 2012 21:23:46 +0000 (17:23 -0400)
Modules/_datetimemodule.c

index 444cc00d2c543fe85739dd81550814d2b2263348..ef2f7b306a04e54b13aaef4c6525a7cb0fcf42f8 100644 (file)
@@ -3243,8 +3243,10 @@ static PyObject *
 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;