py3: Port a few remaining chr() calls

This commit is contained in:
Kovid Goyal 2019-06-01 15:21:01 +05:30
parent c83cdcf086
commit e049c10729
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 4 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -239,7 +239,7 @@ class PackedIon(PackedData):
def unpack_unsigned_int(self, length): def unpack_unsigned_int(self, length):
# unsigned big-endian (MSB first) # unsigned big-endian (MSB first)
return struct.unpack_from(b'>Q', chr(0) * (8 - length) + self.extract(length))[0] return struct.unpack_from(b'>Q', b'\0' * (8 - length) + self.extract(length))[0]
def property_name(property_number): def property_name(property_number):

View File

@ -487,7 +487,7 @@ class _ZipDecrypter:
self.key0 = self._crc32(c, self.key0) self.key0 = self._crc32(c, self.key0)
self.key1 = (self.key1 + (self.key0 & 255)) & 4294967295 self.key1 = (self.key1 + (self.key0 & 255)) & 4294967295
self.key1 = (self.key1 * 134775813 + 1) & 4294967295 self.key1 = (self.key1 * 134775813 + 1) & 4294967295
self.key2 = self._crc32(chr((self.key1 >> 24) & 255), self.key2) self.key2 = self._crc32(((self.key1 >> 24) & 255), self.key2)
def __call__(self, c): def __call__(self, c):
"""Decrypt a single byte.""" """Decrypt a single byte."""