Skip to content

Commit

Permalink
Fix UTC access for py < 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
septatrix committed Feb 8, 2024
1 parent d3bcbbe commit 2d018fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mkosi/archive.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-License-Identifier: LGPL-2.1+

import datetime
import datetime as dt
import hashlib
import json
import os
Expand Down Expand Up @@ -78,9 +78,9 @@ def make_oci(context: Context, dst: Path) -> None:
layer_archive.rename(ca_store / layer_digest)

creation_time = (
datetime.datetime.fromtimestamp(context.config.source_date_epoch, tz=datetime.UTC)
dt.datetime.fromtimestamp(context.config.source_date_epoch, tz=dt.timezone.UTC)
if context.config.source_date_epoch
else datetime.datetime.now(tz=datetime.UTC)
else dt.datetime.now(tz=dt.timezone.UTC)
).isoformat(timespec="seconds")

oci_config = {
Expand Down

0 comments on commit 2d018fe

Please sign in to comment.