Patchwork D11930: pytype: stop excluding wireprotoserver.py

login
register
mail settings
Submitter phabricator
Date Dec. 15, 2021, 8:47 p.m.
Message ID <differential-rev-PHID-DREV-3sjtd4xpgkcmwn337a7n-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50256/
State New
Headers show

Comments

phabricator - Dec. 15, 2021, 8:47 p.m.
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  The `config` entry is a 2 part tuple, which has `__iter__()`:
  
    File "/mnt/c/Users/Matt/hg/mercurial/wireprotoserver.py", line 253, in _availableapis:
        No attribute '__iter__' on Callable[[Any, Any], Any] [attribute-error]
      In Union[Callable[[Any, Any, Any, Any, Any], None], Callable[[Any, Any], Any]]
    File "/mnt/c/Users/Matt/hg/mercurial/wireprotoserver.py", line 253, in _availableapis:
        No attribute '__iter__' on Callable[[Any, Any, Any, Any, Any], None] [attribute-error]
      In Union[Callable[[Any, Any, Any, Any, Any], None], Callable[[Any, Any], Any]]

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11930

AFFECTED FILES
  mercurial/wireprotoserver.py
  tests/test-check-pytype.t

CHANGE DETAILS




To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-check-pytype.t b/tests/test-check-pytype.t
--- a/tests/test-check-pytype.t
+++ b/tests/test-check-pytype.t
@@ -34,7 +34,6 @@ 
 mercurial/utils/memorytop.py  # not 3.6 compatible
 mercurial/win32.py            # [not-callable]
 mercurial/wireprotoframing.py # [unsupported-operands], [attribute-error], [import-error]
-mercurial/wireprotoserver.py  # line 253, in _availableapis: No attribute '__iter__' on Callable[[Any, Any], Any] [attribute-error]
 mercurial/wireprotov1peer.py  # [attribute-error]
 mercurial/wireprotov1server.py  # BUG?: BundleValueError handler accesses subclass's attrs
 
@@ -68,7 +67,6 @@ 
   >    -x mercurial/utils/memorytop.py \
   >    -x mercurial/win32.py \
   >    -x mercurial/wireprotoframing.py \
-  >    -x mercurial/wireprotoserver.py \
   >    -x mercurial/wireprotov1peer.py \
   >    -x mercurial/wireprotov1server.py \
   >  > $TESTTMP/pytype-output.txt || cat $TESTTMP/pytype-output.txt
diff --git a/mercurial/wireprotoserver.py b/mercurial/wireprotoserver.py
--- a/mercurial/wireprotoserver.py
+++ b/mercurial/wireprotoserver.py
@@ -250,7 +250,7 @@ 
     # Registered APIs are made available via config options of the name of
     # the protocol.
     for k, v in API_HANDLERS.items():
-        section, option = v[b'config']
+        section, option = v[b'config']  # pytype: disable=attribute-error
         if repo.ui.configbool(section, option):
             apis.add(k)