From 9a7920a2dea1bd3193036f0b182144c122c6a779 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Wed, 20 Mar 2024 13:45:34 +0000 Subject: [PATCH] Fix DeprecationWarning: datetime.datetime.utcfromtimestamp() --- Lib/ufo2ft/fontInfoData.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/ufo2ft/fontInfoData.py b/Lib/ufo2ft/fontInfoData.py index 941c8d33..3373aa65 100644 --- a/Lib/ufo2ft/fontInfoData.py +++ b/Lib/ufo2ft/fontInfoData.py @@ -17,7 +17,7 @@ import os import time import unicodedata -from datetime import datetime +from datetime import datetime, timezone from fontTools import ufoLib from fontTools.misc.fixedTools import otRound @@ -104,7 +104,7 @@ def openTypeHeadCreatedFallback(info): now. """ if "SOURCE_DATE_EPOCH" in os.environ: - t = datetime.utcfromtimestamp(int(os.environ["SOURCE_DATE_EPOCH"])) + t = datetime.fromtimestamp(int(os.environ["SOURCE_DATE_EPOCH"]), timezone.utc) return t.strftime(_date_format) else: return dateStringForNow()