Patchwork D107: util: remove dead code which used to be for old python2 versions

login
register
mail settings
Submitter phabricator
Date July 17, 2017, 6:31 p.m.
Message ID <f9886c1775aeaef8873cd3449b1429ca@localhost.localdomain>
Download mbox | patch
Permalink /patch/22450/
State Not Applicable
Headers show

Comments

phabricator - July 17, 2017, 6:31 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG9a2ee9591acc: util: remove dead code which used to be for old python2 versions (authored by alex_gaynor).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D107?vs=204&id=208

REVISION DETAIL
  https://phab.mercurial-scm.org/D107

AFFECTED FILES
  mercurial/util.py

CHANGE DETAILS




EMAIL PREFERENCES
  https://phab.mercurial-scm.org/settings/panel/emailpreferences/

To: alex_gaynor, #hg-reviewers, durin42
Cc: indygreg, mercurial-devel

Patch

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'