D6103: py3: use pycompat.iterbytestr to convert memoryview slice to bytestring before passing to itertools.takewhile

Kwan (Ian Moody) phabricator at mercurial-scm.org
Fri Mar 15 22:40:33 EDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGe7b84ffb06d9: py3: use pycompat.iterbytestr to convert memoryview slice to bytestring (authored by Kwan, committed by ).

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D6103?vs=14494&id=14511#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6103?vs=14494&id=14511

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

AFFECTED FILES
  hgext/phabricator.py

CHANGE DETAILS

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -675,7 +675,7 @@
     length = len(text)
     while pos < length:
         symbol = b''.join(itertools.takewhile(lambda ch: ch not in special,
-                                              view[pos:]))
+                                              pycompat.iterbytestr(view[pos:])))
         if symbol:
             yield (b'symbol', symbol, pos)
             pos += len(symbol)



To: Kwan, #hg-reviewers
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list