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

login
register
mail settings
Submitter phabricator
Date March 16, 2019, 2:40 a.m.
Message ID <b064fc32cf8e6b2c6283a5f7e958ac67@localhost.localdomain>
Download mbox | patch
Permalink /patch/39273/
State Not Applicable
Headers show

Comments

phabricator - March 16, 2019, 2:40 a.m.
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




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

Patch

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)