[entities][CWCache] handle classic datetime vs None comparison bug stable
authorAdrien Di Mascio <Adrien.DiMascio@logilab.fr>
Mon, 08 Jun 2009 18:29:35 +0200
branchstable
changeset 2060 10d9fbdbed35
parent 2056 57d287a2132a
child 2061 6a5044f15cb9
[entities][CWCache] handle classic datetime vs None comparison bug
entities/lib.py
--- a/entities/lib.py	Fri Jun 05 18:54:39 2009 +0200
+++ b/entities/lib.py	Mon Jun 08 18:29:35 2009 +0200
@@ -141,4 +141,7 @@
                          {'t': datetime.now(), 'x': self.eid}, 'x')
 
     def valid(self, date):
-        return date < self.timestamp
+        if date:
+            return date < self.timestamp
+        return False
+