diff mercurial/match.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 5c48fd4c0e68
line wrap: on
line diff
--- a/mercurial/match.py	Sun Jan 05 22:12:02 2025 -0500
+++ b/mercurial/match.py	Sun Jan 05 22:23:31 2025 -0500
@@ -532,7 +532,7 @@
     '''Matches everything.'''
 
     def __init__(self, badfn=None):
-        super(alwaysmatcher, self).__init__(badfn)
+        super().__init__(badfn)
 
     def always(self):
         return True
@@ -554,7 +554,7 @@
     '''Matches nothing.'''
 
     def __init__(self, badfn=None):
-        super(nevermatcher, self).__init__(badfn)
+        super().__init__(badfn)
 
     # It's a little weird to say that the nevermatcher is an exact matcher
     # or a prefix matcher, but it seems to make sense to let callers take
@@ -581,7 +581,7 @@
     """A matcher adapter for a simple boolean function"""
 
     def __init__(self, predfn, predrepr=None, badfn=None):
-        super(predicatematcher, self).__init__(badfn)
+        super().__init__(badfn)
         self.matchfn = predfn
         self._predrepr = predrepr
 
@@ -654,7 +654,7 @@
     """
 
     def __init__(self, root, kindpats, badfn=None):
-        super(patternmatcher, self).__init__(badfn)
+        super().__init__(badfn)
         kindpats.sort()
 
         if rustmod is not None:
@@ -742,7 +742,7 @@
 
 class includematcher(basematcher):
     def __init__(self, root, kindpats, badfn=None):
-        super(includematcher, self).__init__(badfn)
+        super().__init__(badfn)
         if rustmod is not None:
             # We need to pass the patterns to Rust because they can contain
             # patterns from the user interface
@@ -823,7 +823,7 @@
     """
 
     def __init__(self, files, badfn=None):
-        super(exactmatcher, self).__init__(badfn)
+        super().__init__(badfn)
 
         if isinstance(files, list):
             self._files = files
@@ -898,7 +898,7 @@
     """
 
     def __init__(self, m1, m2):
-        super(differencematcher, self).__init__()
+        super().__init__()
         self._m1 = m1
         self._m2 = m2
         self.bad = m1.bad
@@ -988,7 +988,7 @@
 
 class intersectionmatcher(basematcher):
     def __init__(self, m1, m2):
-        super(intersectionmatcher, self).__init__()
+        super().__init__()
         self._m1 = m1
         self._m2 = m2
         self.bad = m1.bad
@@ -1082,7 +1082,7 @@
     """
 
     def __init__(self, path: bytes, matcher: basematcher) -> None:
-        super(subdirmatcher, self).__init__()
+        super().__init__()
         self._path = path
         self._matcher = matcher
         self._always = matcher.always()
@@ -1174,7 +1174,7 @@
     """
 
     def __init__(self, path, matcher, badfn=None):
-        super(prefixdirmatcher, self).__init__(badfn)
+        super().__init__(badfn)
         if not path:
             raise error.ProgrammingError(b'prefix path must not be empty')
         self._path = path
@@ -1233,7 +1233,7 @@
 
     def __init__(self, matchers):
         m1 = matchers[0]
-        super(unionmatcher, self).__init__()
+        super().__init__()
         self.traversedir = m1.traversedir
         self._matchers = matchers