diff mercurial/chgserver.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 25b344f2aeef
line wrap: on
line diff
--- a/mercurial/chgserver.py	Sun Jan 05 22:12:02 2025 -0500
+++ b/mercurial/chgserver.py	Sun Jan 05 22:23:31 2025 -0500
@@ -223,7 +223,7 @@
 def _newchgui(srcui, csystem, attachio):
     class chgui(srcui.__class__):
         def __init__(self, src=None):
-            super(chgui, self).__init__(src)
+            super().__init__(src)
             if src:
                 self._csystem = getattr(src, '_csystem', csystem)
             else:
@@ -359,7 +359,7 @@
     def __init__(
         self, ui, repo, fin, fout, sock, prereposetups, hashstate, baseaddress
     ):
-        super(chgcmdserver, self).__init__(
+        super().__init__(
             _newchgui(ui, channeledsystem(fin, fout, b'S'), self.attachio),
             repo,
             fin,
@@ -376,7 +376,7 @@
             self.capabilities[b'validate'] = chgcmdserver.validate
 
     def cleanup(self):
-        super(chgcmdserver, self).cleanup()
+        super().cleanup()
         # dispatch._runcatch() does not flush outputs if exception is not
         # handled by dispatch._dispatch()
         self.ui.flush()
@@ -572,7 +572,7 @@
         globaloldios = self._oldios
         self._oldios = []
         try:
-            return super(chgcmdserver, self).runcommand()
+            return super().runcommand()
         finally:
             self._restoreio()
             self._oldios = globaloldios