# HG changeset patch # User Gregory Szorc # Date 2022-02-21 17:39:09 # Node ID 5ed68dc6494835ab3f94cf25ef926fdcd0ce297e # Parent 563eb25e079b5f70cae9f48fdce06158eb227c06 wireprotoframing: remove Python 2 support code Differential Revision: https://phab.mercurial-scm.org/D12303 diff --git a/mercurial/wireprotoframing.py b/mercurial/wireprotoframing.py --- a/mercurial/wireprotoframing.py +++ b/mercurial/wireprotoframing.py @@ -761,11 +761,6 @@ class zlibdecoder(object): self._decompressor = zlib.decompressobj() def decode(self, data): - # Python 2's zlib module doesn't use the buffer protocol and can't - # handle all bytes-like types. - if not pycompat.ispy3 and isinstance(data, bytearray): - data = bytes(data) - return self._decompressor.decompress(data)