Message170780
| Author |
belopolsky |
| Recipients |
belopolsky, jftuga, lanhel, r.david.murray, ronaldoussoren, skrah |
| Date |
2012年09月20日.01:48:08 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1348105689.21.0.178304655738.issue15973@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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);
} |
|