wireprotoserver: subclass the new `baseprotocolhandler` Protocol class
authorMatt Harbison <matt_harbison@yahoo.com>
Thu, 24 Oct 2024 20:50:47 -0400
changeset 52125 1938d72e7a16
parent 52124 47981c4bfeee
child 52126 e7812caacc3c
wireprotoserver: subclass the new `baseprotocolhandler` Protocol class
mercurial/wireprotoserver.py
--- a/mercurial/wireprotoserver.py	Thu Oct 24 20:47:12 2024 -0400
+++ b/mercurial/wireprotoserver.py	Thu Oct 24 20:50:47 2024 -0400
@@ -19,7 +19,6 @@
     wireprototypes,
     wireprotov1server,
 )
-from .interfaces import util as interfaceutil
 from .utils import (
     compression,
     stringutil,
@@ -56,8 +55,7 @@
     return b''.join(chunks)
 
 
-@interfaceutil.implementer(wireprototypes.baseprotocolhandler)
-class httpv1protocolhandler:
+class httpv1protocolhandler(wireprototypes.baseprotocolhandler):
     def __init__(self, req, ui, checkperm):
         self._req = req
         self._ui = ui
@@ -65,7 +63,7 @@
         self._protocaps = None
 
     @property
-    def name(self):
+    def name(self) -> bytes:
         return b'http-v1'
 
     def getargs(self, args):
@@ -375,8 +373,7 @@
     fout.flush()
 
 
-@interfaceutil.implementer(wireprototypes.baseprotocolhandler)
-class sshv1protocolhandler:
+class sshv1protocolhandler(wireprototypes.baseprotocolhandler):
     """Handler for requests services via version 1 of SSH protocol."""
 
     def __init__(self, ui, fin, fout):
@@ -386,7 +383,7 @@
         self._protocaps = set()
 
     @property
-    def name(self):
+    def name(self) -> bytes:
         return wireprototypes.SSHV1
 
     def getargs(self, args):