Skip to content

Commit

Permalink
fix warning (#3338)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianna authored Dec 21, 2024
1 parent 288851a commit 0cc66e8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
13 changes: 10 additions & 3 deletions dev/generate-kernel-signatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,16 @@


def reproducible_datetime():
build_date = datetime.datetime.utcfromtimestamp(
int(os.environ.get("SOURCE_DATE_EPOCH", time.time()))
)
import sys

timestamp = int(os.environ.get("SOURCE_DATE_EPOCH", time.time()))

if sys.version_info >= (3, 11):
build_date = datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)
else:
build_date = datetime.datetime.utcfromtimestamp(
int(os.environ.get("SOURCE_DATE_EPOCH", time.time()))
)
return build_date.isoformat().replace("T", " AT ")[:22]


Expand Down
13 changes: 10 additions & 3 deletions dev/generate-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,16 @@


def reproducible_datetime():
build_date = datetime.datetime.utcfromtimestamp(
int(os.environ.get("SOURCE_DATE_EPOCH", time.time()))
)
import sys

timestamp = int(os.environ.get("SOURCE_DATE_EPOCH", time.time()))

if sys.version_info >= (3, 11):
build_date = datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)
else:
build_date = datetime.datetime.utcfromtimestamp(
int(os.environ.get("SOURCE_DATE_EPOCH", time.time()))
)
return build_date.isoformat().replace("T", " AT ")[:22]


Expand Down

0 comments on commit 0cc66e8

Please sign in to comment.