to_bytes() named argument 'length' removed (to work with PyPy)

This commit is contained in:
max 2018-06-04 13:33:48 +03:00
parent 2e43fb3217
commit e09cd73ce4

View File

@ -28,7 +28,7 @@ def get_byte_array(integer):
# Reference: https://core.telegram.org/mtproto/auth_key # Reference: https://core.telegram.org/mtproto/auth_key
return int.to_bytes( return int.to_bytes(
integer, integer,
length=(integer.bit_length() + 8 - 1) // 8, # 8 bits per byte, (integer.bit_length() + 8 - 1) // 8, # 8 bits per byte,
byteorder='big', byteorder='big',
signed=False signed=False
) )