From d86624877de7b7db91c2966dd9bfa6ef8721b29e Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Tue, 27 Sep 2005 03:34:58 +0000 Subject: [PATCH] Fixed #213 -- Improved formfields.TimeField.html2python() so that it doesn't fail for None input git-svn-id: http://code.djangoproject.com/svn/django/trunk@702 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/core/formfields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/core/formfields.py b/django/core/formfields.py index 5056dd7badf7f..7587b67170dc4 100644 --- a/django/core/formfields.py +++ b/django/core/formfields.py @@ -652,7 +652,7 @@ def html2python(data): except ValueError: # seconds weren't provided time_tuple = time.strptime(data, '%H:%M') return datetime.time(*time_tuple[3:6]) - except ValueError: + except (ValueError, TypeError): return None html2python = staticmethod(html2python)