From ddbcfe83dd26fc6c7e193134e91405fed9dc1cf4 Mon Sep 17 00:00:00 2001 From: Philip Allgaier Date: Fri, 18 Sep 2020 15:29:40 +0200 Subject: [PATCH] Catch TypeError in strptime() template helper (#40226) --- homeassistant/helpers/template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/helpers/template.py b/homeassistant/helpers/template.py index 79f372e3ff1..bef6323d10c 100644 --- a/homeassistant/helpers/template.py +++ b/homeassistant/helpers/template.py @@ -908,7 +908,7 @@ def strptime(string, fmt): """Parse a time string to datetime.""" try: return datetime.strptime(string, fmt) - except (ValueError, AttributeError): + except (ValueError, AttributeError, TypeError): return string