From 9739a3585f8771b17810cc60e6057184f460200f Mon Sep 17 00:00:00 2001 From: Daniel Lindsley Date: Sun, 3 Nov 2013 13:35:09 -0800 Subject: [PATCH] Added exception checking for new versions of ``dateutil``. --- tastypie/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tastypie/fields.py b/tastypie/fields.py index 597dc3370..513408064 100644 --- a/tastypie/fields.py +++ b/tastypie/fields.py @@ -883,7 +883,7 @@ def convert(self, value): def to_time(self, s): try: dt = parse(s) - except ValueError as e: + except (ValueError, TypeError) as e: raise ApiFieldError(str(e)) else: return datetime.time(dt.hour, dt.minute, dt.second)