diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -295,16 +295,10 @@ try: buffer = buffer except NameError: - if not pycompat.ispy3: - def buffer(sliceable, offset=0, length=None): - if length is not None: - return sliceable[offset:offset + length] - return sliceable[offset:] - else: - def buffer(sliceable, offset=0, length=None): - if length is not None: - return memoryview(sliceable)[offset:offset + length] - return memoryview(sliceable)[offset:] + def buffer(sliceable, offset=0, length=None): + if length is not None: + return memoryview(sliceable)[offset:offset + length] + return memoryview(sliceable)[offset:] closefds = pycompat.osname == 'posix'