]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
util/import_gcry: Make compatible with Python 3.4
authorVladimir Serbinenko <phcoder@gmail.com>
Mon, 7 Jul 2025 14:52:17 +0000 (14:52 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Fri, 11 Jul 2025 21:12:51 +0000 (23:12 +0200)
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/import_gcry.py

index ca918c7779869d1585e22ffd157a006f0f2f7daa..9b0e8d936699e8e31724e066ca12197626780519 100644 (file)
@@ -249,15 +249,15 @@ for cipher_file in cipher_files:
                 if not re.search (" *};", line) is None:
                     escapenl = " \\" if ismddefine else ""
                     if not iscomma:
-                        fw.write (f"    ,{escapenl}\n")
-                    fw.write (f"    GRUB_UTIL_MODNAME(\"%s\"){escapenl}\n" % modname);
+                        fw.write ("    ,%s\n" % escapenl)
+                    fw.write ("    GRUB_UTIL_MODNAME(\"%s\")%s\n" % (modname, escapenl))
                     if ismd:
                         if not (mdname in mdblocksizes):
                             print ("ERROR: Unknown digest blocksize: %s\n"
                                    % mdname)
                             exit (1)
-                        fw.write (f"    .blocksize = %s{escapenl}\n"
-                                  % mdblocksizes [mdname])
+                        fw.write ("    .blocksize = %s%s\n"
+                                  % (mdblocksizes [mdname], escapenl))
                     ismd = False
                     ismddefine = False
                     mdarg = 0
@@ -361,7 +361,7 @@ for cipher_file in cipher_files:
             if isc and not m is None:
                 bs = m.groups()[0]
                 bits = m.groups()[2]
-                mdname = f"_gcry_digest_spec_blake2{bs}_{bits}"
+                mdname = "_gcry_digest_spec_blake2%s_%s" % (bs, bits)
                 mdnames.append (mdname)
 
             m = re.match ("(const )?gcry_md_spec_t", line)