Replace deprecated datetime.utcfromtimestamp()

The datetime.utcfromtimestamp() is deprecated in Python 3.12.
Replace datetime.utcfromtimestamp() with datetime.fromtimestamp().

Change-Id: I01d6b94de394413aa13a045ab2c36504e65a6f5a
Signed-off-by: Takashi Natsume <takanattie@gmail.com>
This commit is contained in:
Takashi Natsume 2024-10-01 21:53:46 +09:00
parent 4807999749
commit 29b0e478a7

View File

@ -74,7 +74,7 @@ master_doc = 'index'
project = 'Swift'
if 'SOURCE_DATE_EPOCH' in os.environ:
now = float(os.environ.get('SOURCE_DATE_EPOCH'))
now = datetime.datetime.utcfromtimestamp(now)
now = datetime.datetime.fromtimestamp(now, tz=datetime.timezone.utc)
else:
now = datetime.date.today()
copyright = '%d, OpenStack Foundation' % now.year