From f911ee78a0b4e557751e0f20f39ae45e5dcc818c Mon Sep 17 00:00:00 2001 From: Mike Edmunds Date: Fri, 22 Sep 2023 10:51:09 -0700 Subject: [PATCH] Fix Python 3.12 deprecation warning --- anymail/backends/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anymail/backends/base.py b/anymail/backends/base.py index 0168fe12..87bbf1e2 100644 --- a/anymail/backends/base.py +++ b/anymail/backends/base.py @@ -462,7 +462,7 @@ def aware_datetime(self, value): dt = datetime(value.year, value.month, value.day) # naive, midnight else: try: - dt = datetime.utcfromtimestamp(value).replace(tzinfo=timezone.utc) + dt = datetime.fromtimestamp(value, timezone.utc) except (TypeError, ValueError): return value if is_naive(dt):