python3: Convert chr to six.int2byte

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
IWAMOTO Toshihiro 2015-07-03 11:27:18 +09:00 committed by FUJITA Tomonori
parent c31d6e8669
commit fa4318ba69
1 changed files with 2 additions and 1 deletions

View File

@ -750,7 +750,8 @@ class _AddrPrefix(StringifyMixin):
# clear trailing bits in the last octet.
# rfc doesn't require this.
mask = 0xff00 >> (self.length % 8)
last_byte = chr(six.indexbytes(bin_addr, byte_length - 1) & mask)
last_byte = six.int2byte(
six.indexbytes(bin_addr, byte_length - 1) & mask)
bin_addr = bin_addr[:byte_length - 1] + last_byte
self.addr = self._from_bin(bin_addr)