mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Catch TypeError in strptime() template helper (#40226)
This commit is contained in:
parent
976d8f7abe
commit
ddbcfe83dd
@ -908,7 +908,7 @@ def strptime(string, fmt):
|
|||||||
"""Parse a time string to datetime."""
|
"""Parse a time string to datetime."""
|
||||||
try:
|
try:
|
||||||
return datetime.strptime(string, fmt)
|
return datetime.strptime(string, fmt)
|
||||||
except (ValueError, AttributeError):
|
except (ValueError, AttributeError, TypeError):
|
||||||
return string
|
return string
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user