[3.12 regression] don't access to __class__ directly, it may raise AttributeError
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 14 Apr 2011 11:38:10 +0200
changeset 7221 dc79f1a3c6ed
parent 7218 78622865b6c1
child 7222 fcb8932082a5
[3.12 regression] don't access to __class__ directly, it may raise AttributeError
server/sqlutils.py
--- a/server/sqlutils.py	Wed Apr 13 11:46:00 2011 +0200
+++ b/server/sqlutils.py	Thu Apr 14 11:38:10 2011 +0200
@@ -275,7 +275,7 @@
                     value = self._binary(value)
                 # XXX needed for sqlite but I don't think it is for other backends
                 # Note: use is __class__ since issubclass(datetime, date)
-                elif atype in ('Datetime', 'TZDatetime') and value.__class__ is date:
+                elif atype in ('Datetime', 'TZDatetime') and type(value) is date:
                     value = todatetime(value)
                 elif atype == 'Date' and isinstance(value, datetime):
                     value = todate(value)