Alexander Belopolsky added the comment:

I think the following simple patch should do the trick.  I'll add some tests 
and commit.  Should this get in 3.3.0? 


diff -r 19c74cadea95 Modules/_datetimemodule.c
--- a/Modules/_datetimemodule.c Wed Sep 19 08:25:01 2012 +0300
+++ b/Modules/_datetimemodule.c Wed Sep 19 21:42:51 2012 -0400
@@ -3215,6 +3215,11 @@
 {
     if (op != Py_EQ && op != Py_NE)
         Py_RETURN_NOTIMPLEMENTED;
+    if (Py_TYPE(other) != &PyDateTime_TimeZoneType)
+       if (op == Py_EQ)
+           Py_RETURN_FALSE;
+       else
+           Py_RETURN_TRUE;
     return delta_richcompare(self->offset, other->offset, op);
 }

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15973>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to