public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib/crypto: tests: Fix syntax error for old python versions
@ 2026-01-07  1:58 Jie Zhan
  2026-01-07  3:30 ` Eric Biggers
  0 siblings, 1 reply; 3+ messages in thread
From: Jie Zhan @ 2026-01-07  1:58 UTC (permalink / raw)
  To: ebiggers, ardb, dhowells
  Cc: linux-kernel, linuxarm, zhanjie9, jonathan.cameron

'make binrpm-pkg' throws me this error, with Python 3.9:

*** Error compiling '.../gen-hash-testvecs.py'...
  File ".../scripts/crypto/gen-hash-testvecs.py", line 121
    return f'{alg.upper().replace('-', '_')}_DIGEST_SIZE'
                                   ^
SyntaxError: f-string: unmatched '('

Old python versions, presumably <= 3.11, can't resolve these quotes.

Fix it with double quotes for compatibility.

Fixes: 15c64c47e484 ("lib/crypto: tests: Add SHA3 kunit tests")
Signed-off-by: Jie Zhan <zhanjie9@hisilicon.com>
---
 scripts/crypto/gen-hash-testvecs.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/crypto/gen-hash-testvecs.py b/scripts/crypto/gen-hash-testvecs.py
index c1d0517140bd..c773294fba64 100755
--- a/scripts/crypto/gen-hash-testvecs.py
+++ b/scripts/crypto/gen-hash-testvecs.py
@@ -118,7 +118,7 @@ def print_c_struct_u8_array_field(name, value):
 def alg_digest_size_const(alg):
     if alg.startswith('blake2'):
         return f'{alg.upper()}_HASH_SIZE'
-    return f'{alg.upper().replace('-', '_')}_DIGEST_SIZE'
+    return f"{alg.upper().replace('-', '_')}_DIGEST_SIZE"
 
 def gen_unkeyed_testvecs(alg):
     print('')
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-07  3:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-07  1:58 [PATCH] lib/crypto: tests: Fix syntax error for old python versions Jie Zhan
2026-01-07  3:30 ` Eric Biggers
2026-01-07  3:43   ` Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox