Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/context.py @ 36728:c6901665cd5b
py3: make sure __repr__ returns a str
# skip-blame because just r'' prefix
Differential Revision: https://phab.mercurial-scm.org/D2652
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sun, 04 Mar 2018 22:40:33 +0530 |
parents | 470df8c5b781 |
children | 981f328d6d16 |
comparison
equal
deleted
inserted
replaced
36727:470df8c5b781 | 36728:c6901665cd5b |
---|---|
746 return "%s@???" % self.path() | 746 return "%s@???" % self.path() |
747 | 747 |
748 __str__ = encoding.strmethod(__bytes__) | 748 __str__ = encoding.strmethod(__bytes__) |
749 | 749 |
750 def __repr__(self): | 750 def __repr__(self): |
751 return "<%s %s>" % (type(self).__name__, str(self)) | 751 return r"<%s %s>" % (type(self).__name__, str(self)) |
752 | 752 |
753 def __hash__(self): | 753 def __hash__(self): |
754 try: | 754 try: |
755 return hash((self._path, self._filenode)) | 755 return hash((self._path, self._filenode)) |
756 except AttributeError: | 756 except AttributeError: |