Fix compatibility with Python < 3.5

This commit is contained in:
Unrud 2017-09-11 20:05:54 +02:00
parent ee3fb71f7d
commit 282a759174

View File

@ -311,7 +311,7 @@ def path_to_filesystem(root, *paths):
def left_encode_int(v):
length = int(log(v, 256)) + 1 if v != 0 else 1
return b"%c%s" % (length, v.to_bytes(length, 'little'))
return bytes((length,)) + v.to_bytes(length, 'little')
class UnsafePathError(ValueError):