D2109: py3: make sure we return str from __repr__

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Sun Feb 11 09:06:04 EST 2018


yuja requested changes to this revision.
yuja added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> match.py:456
>      def __repr__(self):
> -        return ('<exactmatcher files=%r>' % self._files)
> +        return (r'<exactmatcher files=%r>' % self._files)
>  

Maybe you know, `'%r' % [bytes, ...]` is incompatible across python versions,
so it's probably better to build a repr string in bytes, and convert it
to unicode.

See https://phab.mercurial-scm.org/rHGf0827211eb1fba515f4db9d32abaedf535e07375 and https://phab.mercurial-scm.org/rHGfc44c2657dc54b680583242916608c858026df19 for example.

REPOSITORY
  rHG Mercurial

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

To: pulkit, #hg-reviewers, durin42, yuja
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list