Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c44f427e authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Fix deprecated utcfromtimestamp() usage." into main

parents a3cea59f be3dbb2a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -49,8 +49,8 @@ BYTES_IN_MB = 1024 * 1024
# Use a fixed timestamp (01/01/2009 00:00:00 UTC) for files when packaging
# images. (b/24377993, b/80600931)
FIXED_FILE_TIMESTAMP = int((
    datetime.datetime(2009, 1, 1, 0, 0, 0, 0, None) -
    datetime.datetime.utcfromtimestamp(0)).total_seconds())
    datetime.datetime(2009, 1, 1, 0, 0, 0, 0, datetime.UTC) -
    datetime.datetime.fromtimestamp(0, datetime.UTC)).total_seconds())


class BuildImageError(Exception):
+1 −1
Original line number Diff line number Diff line
@@ -2993,7 +2993,7 @@ def ZipWrite(zip_file, filename, arcname=None, perms=0o644,
    os.chmod(filename, perms)

    # Use a fixed timestamp so the output is repeatable.
    # Note: Use of fromtimestamp rather than utcfromtimestamp here is
    # Note: Use of fromtimestamp without specifying a timezone here is
    # intentional. zip stores datetimes in local time without a time zone
    # attached, so we need "epoch" but in the local time zone to get 2009/01/01
    # in the zip archive.