From patchwork Fri Oct 18 11:08:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D7129: py3: don't index into bytes in phabricator's _tokenize() From: phabricator X-Patchwork-Id: 42473 Message-Id: <3a91628f746e381c82d3e47fa43240a4@localhost.localdomain> To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Fri, 18 Oct 2019 11:08:29 +0000 Closed by commit rHGb3a1ba3f46f1: py3: don't index into bytes in phabricator's _tokenize() (authored by Kwan). This revision was automatically updated to reflect the committed changes. This revision was not accepted when it landed; it landed in state "Needs Review". REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D7129?vs=17328&id=17339 CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7129/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7129 AFFECTED FILES hgext/phabricator.py CHANGE DETAILS To: Kwan, #hg-reviewers Cc: mercurial-devel diff --git a/hgext/phabricator.py b/hgext/phabricator.py --- a/hgext/phabricator.py +++ b/hgext/phabricator.py @@ -1274,8 +1274,8 @@ yield (b'symbol', symbol, pos) pos += len(symbol) else: # special char, ignore space - if text[pos] != b' ': - yield (text[pos], None, pos) + if text[pos : pos + 1] != b' ': + yield (text[pos : pos + 1], None, pos) pos += 1 yield (b'end', None, pos)