Commits

Jake Teton-Landis  committed 4160c79

handle TypeError for `parse(data)` in _has_changed

  • Participants
  • Parent commits 3d7eef4

Comments (0)

Files changed (1)

File timedelta/widgets.py

                 initial = parse(initial)
 
         if not isinstance(data, datetime.timedelta):
-            data = parse(data)
+            try:
+                data = parse(data)
+            except TypeError:
+                # initial didn't throw a TypeError, so this must be different
+                # from initial
+                return True
         
         return initial != data