# HG changeset patch # User Alex Gaynor # Date 1500309487 14400 # Node ID 9a2ee9591acc4d5f5ab6bbb7054cb62cb5f29a62 # Parent 4cd4344a53c4f42c9cda3f7ca06dc1ab74316e3f util: remove dead code which used to be for old python2 versions Differential Revision: https://phab.mercurial-scm.org/D107 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'