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

This commit is contained in:
Philip Allgaier 2020-09-18 15:29:40 +02:00 committed by GitHub
parent 976d8f7abe
commit ddbcfe83dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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