mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +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."""
|
||||
try:
|
||||
return datetime.strptime(string, fmt)
|
||||
except (ValueError, AttributeError):
|
||||
except (ValueError, AttributeError, TypeError):
|
||||
return string
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user