Mercurial > public > mercurial-scm > hg-stable
diff mercurial/mdiff.py @ 50937:e586a7eb380a
diff-option: move attributes handling to sysstr
Attributes are `str` and should be handled as such.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 31 Aug 2023 01:19:49 +0200 |
parents | 362d5a2ffd17 |
children | d718eddf01d9 |
line wrap: on
line diff
--- a/mercurial/mdiff.py Fri Sep 01 12:11:11 2023 +0200 +++ b/mercurial/mdiff.py Thu Aug 31 01:19:49 2023 +0200 @@ -78,7 +78,7 @@ v = opts.get(k) if v is None: v = self.defaults[k] - setattr(self, k, v) + setattr(self, pycompat.sysstr(k), v) try: self.context = int(self.context) @@ -89,14 +89,15 @@ ) def copy(self, **kwargs): - opts = {k: getattr(self, k) for k in self.defaults} + opts = {k: getattr(self, pycompat.sysstr(k)) for k in self.defaults} opts = pycompat.strkwargs(opts) opts.update(kwargs) return diffopts(**opts) def __bytes__(self): return b", ".join( - b"%s: %r" % (k, getattr(self, k)) for k in self.defaults + b"%s: %r" % (k, getattr(self, pycompat.sysstr(k))) + for k in self.defaults ) __str__ = encoding.strmethod(__bytes__)