comparison mercurial/wireprotoframing.py @ 48900:5ed68dc64948

wireprotoframing: remove Python 2 support code Differential Revision: https://phab.mercurial-scm.org/D12303
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 21 Feb 2022 10:39:09 -0700
parents 6000f5b25c9b
children f254fc73d956
comparison
equal deleted inserted replaced
48899:563eb25e079b 48900:5ed68dc64948
759 ) 759 )
760 760
761 self._decompressor = zlib.decompressobj() 761 self._decompressor = zlib.decompressobj()
762 762
763 def decode(self, data): 763 def decode(self, data):
764 # Python 2's zlib module doesn't use the buffer protocol and can't
765 # handle all bytes-like types.
766 if not pycompat.ispy3 and isinstance(data, bytearray):
767 data = bytes(data)
768
769 return self._decompressor.decompress(data) 764 return self._decompressor.decompress(data)
770 765
771 766
772 class zstdbaseencoder(object): 767 class zstdbaseencoder(object):
773 def __init__(self, level): 768 def __init__(self, level):