Use isinstance() instead of type comparison
authorRémi Cardona <remi.cardona@logilab.fr>
Mon, 14 Sep 2015 11:16:10 +0200
changeset 10595 c7a090052e5f
parent 10594 6a55853f14c9
child 10596 3a7ce5c9fe35
Use isinstance() instead of type comparison
devtools/__init__.py
--- a/devtools/__init__.py	Tue Sep 15 15:10:59 2015 +0200
+++ b/devtools/__init__.py	Mon Sep 14 11:16:10 2015 +0200
@@ -842,7 +842,7 @@
                             except Exception:
                                 # DateTime used as Time?
                                 row[cellindex] = strptime(value, '%Y-%m-%d %H:%M:%S')
-                        if vtype == 'Interval' and type(value) is int:
+                        if vtype == 'Interval' and isinstance(value, int):
                             found_date = True
                             row[cellindex] = timedelta(0, value, 0) # XXX value is in number of seconds?
                     if not found_date: