comparison mercurial/chgserver.py @ 48486:7caaefa48794

pytype: stop excluding chgserver.py This teaches pytype about some lazy initialization, and avoids the following: File "/mnt/c/Users/Matt/hg/mercurial/chgserver.py", line 666, in _checkextensions: No attribute '_hashstate' on chgunixservicehandler [attribute-error] File "/mnt/c/Users/Matt/hg/mercurial/chgserver.py", line 672, in _checkextensions: No attribute '_hashstate' on chgunixservicehandler [attribute-error] File "/mnt/c/Users/Matt/hg/mercurial/chgserver.py", line 677, in _bind: No attribute '_realaddress' on chgunixservicehandler [attribute-error] File "/mnt/c/Users/Matt/hg/mercurial/chgserver.py", line 683, in _bind: No attribute '_realaddress' on chgunixservicehandler [attribute-error] File "/mnt/c/Users/Matt/hg/mercurial/chgserver.py", line 686, in _createsymlink: No attribute '_baseaddress' on chgunixservicehandler [attribute-error] File "/mnt/c/Users/Matt/hg/mercurial/chgserver.py", line 686, in _createsymlink: No attribute '_realaddress' on chgunixservicehandler [attribute-error] File "/mnt/c/Users/Matt/hg/mercurial/chgserver.py", line 688, in _createsymlink: No attribute '_baseaddress' on chgunixservicehandler [attribute-error] File "/mnt/c/Users/Matt/hg/mercurial/chgserver.py", line 689, in _createsymlink: No attribute '_realaddress' on chgunixservicehandler [attribute-error] File "/mnt/c/Users/Matt/hg/mercurial/chgserver.py", line 690, in _createsymlink: No attribute '_baseaddress' on chgunixservicehandler [attribute-error] Differential Revision: https://phab.mercurial-scm.org/D11926
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 14 Dec 2021 17:06:32 -0500
parents 227bbb078c2c
children 6000f5b25c9b 201222849987
comparison
equal deleted inserted replaced
48485:ea13dabbe168 48486:7caaefa48794
641 641
642 pollinterval = 1 # [sec] 642 pollinterval = 1 # [sec]
643 643
644 def __init__(self, ui): 644 def __init__(self, ui):
645 self.ui = ui 645 self.ui = ui
646
647 # TODO: use PEP 526 syntax (`_hashstate: hashstate` at the class level)
648 # when 3.5 support is dropped.
649 self._hashstate = None # type: hashstate
650 self._baseaddress = None # type: bytes
651 self._realaddress = None # type: bytes
652
646 self._idletimeout = ui.configint(b'chgserver', b'idletimeout') 653 self._idletimeout = ui.configint(b'chgserver', b'idletimeout')
647 self._lastactive = time.time() 654 self._lastactive = time.time()
648 655
649 def bindsocket(self, sock, address): 656 def bindsocket(self, sock, address):
650 self._inithashstate(address) 657 self._inithashstate(address)