Skip to content

Commit 21f1488

Browse files
author
Fabien Coelho
committed
fix portability for python 3.10
1 parent fc08d52 commit 21f1488

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CacheToolsUtils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ def __init__(self, cache: MutableMapping, sep: str = ".", method: str = "b64"):
253253
if encoder is None:
254254
raise Exception(f"invalid conversion method: {method}")
255255
length = max(1, (AutoPrefixedCache._COUNTER.bit_length() + 7) // 8)
256-
prefix = encoder(AutoPrefixedCache._COUNTER.to_bytes(length)).decode("ASCII")
256+
# NOTE byteorder default added to 3.11
257+
prefix = encoder(AutoPrefixedCache._COUNTER.to_bytes(length, byteorder="big")).decode("ASCII")
257258
AutoPrefixedCache._COUNTER += 1
258259
super().__init__(cache, prefix + sep)
259260

0 commit comments

Comments
 (0)