Mercurial > public > mercurial-scm > hg-stable
diff contrib/python-zstandard/tests/common.py @ 52668: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 | 5e84a96d865b |
children |
line wrap: on
line diff
--- a/contrib/python-zstandard/tests/common.py Sun Jan 05 22:12:02 2025 -0500 +++ b/contrib/python-zstandard/tests/common.py Sun Jan 05 22:23:31 2025 -0500 @@ -102,18 +102,18 @@ """ def __init__(self, *args, **kwargs): - super(NonClosingBytesIO, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self._saved_buffer = None def close(self): self._saved_buffer = self.getvalue() - return super(NonClosingBytesIO, self).close() + return super().close() def getvalue(self): if self.closed: return self._saved_buffer else: - return super(NonClosingBytesIO, self).getvalue() + return super().getvalue() class OpCountingBytesIO(NonClosingBytesIO): @@ -121,19 +121,19 @@ self._flush_count = 0 self._read_count = 0 self._write_count = 0 - return super(OpCountingBytesIO, self).__init__(*args, **kwargs) + return super().__init__(*args, **kwargs) def flush(self): self._flush_count += 1 - return super(OpCountingBytesIO, self).flush() + return super().flush() def read(self, *args): self._read_count += 1 - return super(OpCountingBytesIO, self).read(*args) + return super().read(*args) def write(self, data): self._write_count += 1 - return super(OpCountingBytesIO, self).write(data) + return super().write(data) _source_files = []