Author: Matti Picus <matti.pi...@gmail.com> Branch: py3.6 Changeset: r96070:21f7cebd010e Date: 2019-02-18 17:06 +0200 http://bitbucket.org/pypy/pypy/changeset/21f7cebd010e/
Log: fix translation diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py --- a/pypy/interpreter/unicodehelper.py +++ b/pypy/interpreter/unicodehelper.py @@ -234,11 +234,12 @@ result.append(ch) break except rutf8.CheckError as e: - for ch in s[pos:e.pos]: + end = e.pos + assert end >= 0 + for ch in s[pos:end]: result.append(ch) - upos += rutf8.codepoints_in_utf8(s, start=pos, end=e.pos) - pos = e.pos - assert pos >= 0 + upos += rutf8.codepoints_in_utf8(s, start=pos, end=end) + pos = end # Try to get collect surrogates in one pass # XXX do we care about performance in this case? # XXX should this loop for more than one pair? _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit