8000 Null value for datetimes · fatmazaman/twilio-python@35401ce · GitHub
[go: up one dir, main page]

Skip to content

Commit 35401ce

Browse files
author
Tom Connors
committed
Null value for datetimes
1 parent 6dc027e commit 35401ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

twilio/deserialize.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def iso8601_date(s):
1616
"""
1717
try:
1818
return datetime.datetime.strptime(s, ISO8601_DATE_FORMAT).replace(tzinfo=pytz.utc).date()
19-
except ValueError:
19+
except (TypeError, ValueError):
2020
return s
2121

2222

@@ -29,7 +29,7 @@ def iso8601_datetime(s):
2929
"""
3030
try:
3131
return datetime.datetime.strptime(s, ISO8601_DATETIME_FORMAT).replace(tzinfo=pytz.utc)
32-
except ValueError:
32+
except (TypeError, ValueError):
3333
return s
3434

3535

0 commit comments

Comments
 (0)
0