From 1a195ed1a58e3ec9b7ffdc36e5628f2c247f1015 Mon Sep 17 00:00:00 2001 From: Daniel Fangl Date: Mon, 14 Oct 2024 17:08:46 +0200 Subject: [PATCH] Fix json default error --- moto/iam/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moto/iam/models.py b/moto/iam/models.py index 340bdf6498bd..aece6258f0b9 100644 --- a/moto/iam/models.py +++ b/moto/iam/models.py @@ -3,7 +3,7 @@ import os import re import string -from datetime import datetime +from datetime import date, datetime from typing import Any, Dict, Iterable, List, Optional, Tuple, Union from urllib import parse @@ -102,7 +102,7 @@ def mark_account_as_visited( def _serialize_version_datetime(value: Any) -> str: - if isinstance(value, datetime): + if isinstance(value, date): return value.strftime("%Y-%m-%d") raise TypeError("Unable to serialize value.")