Catch TypeError in strptime() template helper (#40226)
This commit is contained in:
parent
976d8f7abe
commit
ddbcfe83dd
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue