Catch TypeError in strptime() template helper (#40226)

This commit is contained in:
Philip Allgaier authored and GitHub committed 2020-09-18 15:29:40 +02:00
1 parent 976d8f7abe
commit ddbcfe83dd
1 file changed
+1 -1
+1 -1
View File
@@ -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