diff mercurial/patch.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 24ee91ba9aa8
children e627cc25b6f3
line wrap: on
line diff
--- a/mercurial/patch.py	Sun Jan 05 22:12:02 2025 -0500
+++ b/mercurial/patch.py	Sun Jan 05 22:23:31 2025 -0500
@@ -491,7 +491,7 @@
 
 class fsbackend(abstractbackend):
     def __init__(self, ui, basedir):
-        super(fsbackend, self).__init__(ui)
+        super().__init__(ui)
         self.opener = vfsmod.vfs(basedir)
 
     def getfile(self, fname):
@@ -540,7 +540,7 @@
 
 class workingbackend(fsbackend):
     def __init__(self, ui, repo, similarity):
-        super(workingbackend, self).__init__(ui, repo.root)
+        super().__init__(ui, repo.root)
         self.repo = repo
         self.similarity = similarity
         self.removed = set()
@@ -557,14 +557,14 @@
 
     def setfile(self, fname, data, mode, copysource):
         self._checkknown(fname)
-        super(workingbackend, self).setfile(fname, data, mode, copysource)
+        super().setfile(fname, data, mode, copysource)
         if copysource is not None:
             self.copied.append((copysource, fname))
         self.changed.add(fname)
 
     def unlink(self, fname):
         self._checkknown(fname)
-        super(workingbackend, self).unlink(fname)
+        super().unlink(fname)
         self.removed.add(fname)
         self.changed.add(fname)
 
@@ -628,7 +628,7 @@
 
 class repobackend(abstractbackend):
     def __init__(self, ui, repo, ctx, store):
-        super(repobackend, self).__init__(ui)
+        super().__init__(ui)
         self.repo = repo
         self.ctx = ctx
         self.store = store