]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
elf2efi: Add back python 3.7 compat
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 16 Apr 2025 10:00:06 +0000 (12:00 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 16 Apr 2025 11:06:27 +0000 (13:06 +0200)
The walrus operator was introduced in python 3.9 so using it
accidentally bumped the minimum python version to 3.9 from 3.7 and
bluca still cares about keeping this working on 3.8 so let's remove
the usage of the walrus operator.

Follow up for d6a29eee2be6ec8ef1473b8097f6d0a2b9e09f4b

tools/elf2efi.py

index a63d3fc98da56a6d90acd67fdf6d5141f4bd2c14..fff2b1a4be40af399cc3cfbb72c02478024b19fb 100755 (executable)
@@ -611,7 +611,9 @@ def elf2efi(args: argparse.Namespace):
 
     coff.Machine = pe_arch
     coff.NumberOfSections = len(sections)
-    coff.TimeDateStamp = int(sde if (sde := os.environ.get("SOURCE_DATE_EPOCH")) else time.time())
+    coff.TimeDateStamp = int(
+        os.environ.get("SOURCE_DATE_EPOCH") if os.environ.get("SOURCE_DATE_EPOCH") else time.time()
+    )
     coff.SizeOfOptionalHeader = sizeof(opt)
     # EXECUTABLE_IMAGE|LINE_NUMS_STRIPPED|LOCAL_SYMS_STRIPPED|DEBUG_STRIPPED
     # and (32BIT_MACHINE or LARGE_ADDRESS_AWARE)