diff mercurial/utils/compression.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 f4733654f144
children
line wrap: on
line diff
--- a/mercurial/utils/compression.py	Sun Jan 05 22:12:02 2025 -0500
+++ b/mercurial/utils/compression.py	Sun Jan 05 22:23:31 2025 -0500
@@ -379,7 +379,7 @@
 
 class _GzipCompressedStreamReader(_CompressedStreamReader):
     def __init__(self, fh):
-        super(_GzipCompressedStreamReader, self).__init__(fh)
+        super().__init__(fh)
         self._decompobj = zlib.decompressobj()
 
     def _decompress(self, chunk):
@@ -398,7 +398,7 @@
 
 class _BZ2CompressedStreamReader(_CompressedStreamReader):
     def __init__(self, fh):
-        super(_BZ2CompressedStreamReader, self).__init__(fh)
+        super().__init__(fh)
         self._decompobj = bz2.BZ2Decompressor()
 
     def _decompress(self, chunk):
@@ -418,7 +418,7 @@
 
 class _TruncatedBZ2CompressedStreamReader(_BZ2CompressedStreamReader):
     def __init__(self, fh):
-        super(_TruncatedBZ2CompressedStreamReader, self).__init__(fh)
+        super().__init__(fh)
         newbuf = self._decompobj.decompress(b'BZ')
         if newbuf:
             self._pending.append(newbuf)
@@ -426,7 +426,7 @@
 
 class _ZstdCompressedStreamReader(_CompressedStreamReader):
     def __init__(self, fh, zstd):
-        super(_ZstdCompressedStreamReader, self).__init__(fh)
+        super().__init__(fh)
         self._zstd = zstd
         self._decompobj = zstd.ZstdDecompressor().decompressobj()