Skip to content

Commit 277d847

Browse files
committed
fix: handle Z suffix in fromisoformat for Python 3.10 compatibility
1 parent 87727b7 commit 277d847

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rdapapi/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def _parse(value: Optional[str]) -> Optional[datetime]:
5353
if value is None:
5454
return None
5555
try:
56-
return datetime.fromisoformat(value)
56+
return datetime.fromisoformat(value.replace("Z", "+00:00"))
5757
except (ValueError, TypeError):
5858
return None
5959

0 commit comments

Comments
 (0)