Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

lib/crypto: tests: Fix syntax error for old python versions

'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>
Link: https://lore.kernel.org/r/20260107015829.2000699-1-zhanjie9@hisilicon.com
Signed-off-by: Eric Biggers <ebiggers@kernel.org>

authored by

Jie Zhan and committed by
Eric Biggers
0f42c2a5 fcff71fd

+1 -1
+1 -1
scripts/crypto/gen-hash-testvecs.py
··· 118 118 def alg_digest_size_const(alg): 119 119 if alg.startswith('blake2'): 120 120 return f'{alg.upper()}_HASH_SIZE' 121 - return f'{alg.upper().replace('-', '_')}_DIGEST_SIZE' 121 + return f"{alg.upper().replace('-', '_')}_DIGEST_SIZE" 122 122 123 123 def gen_unkeyed_testvecs(alg): 124 124 print('')