Mercurial > public > mercurial-scm > hg
diff mercurial/templateutil.py @ 52643:5cc8deb96b48
pyupgrade: modernize calls to superclass methods
This is the `legacy` fixer in `pyupgrade`, with the loop yielding the offset of
`yield` statements commented out.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sun, 05 Jan 2025 22:23:31 -0500 |
parents | f4733654f144 |
children | e627cc25b6f3 |
line wrap: on
line diff
--- a/mercurial/templateutil.py Sun Jan 05 22:12:02 2025 -0500 +++ b/mercurial/templateutil.py Sun Jan 05 22:23:31 2025 -0500 @@ -549,7 +549,7 @@ """ def __init__(self, make, args=(), name=None, tmpl=None, sep=b''): - super(mappinggenerator, self).__init__(name, tmpl, sep) + super().__init__(name, tmpl, sep) self._make = make self._args = args @@ -564,7 +564,7 @@ """Wrapper for list of template mappings""" def __init__(self, mappings, name=None, tmpl=None, sep=b''): - super(mappinglist, self).__init__(name, tmpl, sep) + super().__init__(name, tmpl, sep) self._mappings = mappings def itermaps(self, context): @@ -582,7 +582,7 @@ """ def __init__(self, mapping, name=None, tmpl=None): - super(mappingdict, self).__init__(name, tmpl) + super().__init__(name, tmpl) self._mapping = mapping def tomap(self, context): @@ -595,7 +595,7 @@ return True def tovalue(self, context, mapping): - return super(mappingdict, self).tovalue(context, mapping)[0] + return super().tovalue(context, mapping)[0] class mappingnone(wrappedvalue): @@ -606,7 +606,7 @@ """ def __init__(self): - super(mappingnone, self).__init__(None) + super().__init__(None) def itermaps(self, context): return iter([])