typing: suppress a few pyi-errors with more recent pytype
authorMatt Harbison <matt_harbison@yahoo.com>
Wed, 13 Jul 2022 11:30:13 -0400
changeset 49389 093e5c274f54
parent 49383 de2e158c380a
child 49390 9f3edb305261
typing: suppress a few pyi-errors with more recent pytype Not sure what's going on here, but these were flagged with pytype 2022.03.21. We can't update to something much more recent, because newer versions complain about various `attr` uses.
mercurial/hgweb/__init__.py
mercurial/subrepo.py
--- a/mercurial/hgweb/__init__.py	Wed Jul 13 18:27:40 2022 +0200
+++ b/mercurial/hgweb/__init__.py	Wed Jul 13 11:30:13 2022 -0400
@@ -18,12 +18,15 @@
 
 from ..utils import procutil
 
+# pytype: disable=pyi-error
 from . import (
     hgweb_mod,
     hgwebdir_mod,
     server,
 )
 
+# pytype: enable=pyi-error
+
 
 def hgweb(config, name=None, baseui=None):
     """create an hgweb wsgi object
--- a/mercurial/subrepo.py	Wed Jul 13 18:27:40 2022 +0200
+++ b/mercurial/subrepo.py	Wed Jul 13 11:30:13 2022 -0400
@@ -1150,7 +1150,7 @@
         # commit revision so we can compare the subrepo state with
         # both. We used to store the working directory one.
         output, err = self._svncommand([b'info', b'--xml'])
-        doc = xml.dom.minidom.parseString(output)
+        doc = xml.dom.minidom.parseString(output)  # pytype: disable=pyi-error
         entries = doc.getElementsByTagName('entry')
         lastrev, rev = b'0', b'0'
         if entries:
@@ -1174,7 +1174,7 @@
         """
         output, err = self._svncommand([b'status', b'--xml'])
         externals, changes, missing = [], [], []
-        doc = xml.dom.minidom.parseString(output)
+        doc = xml.dom.minidom.parseString(output)  # pytype: disable=pyi-error
         for e in doc.getElementsByTagName('entry'):
             s = e.getElementsByTagName('wc-status')
             if not s:
@@ -1319,7 +1319,7 @@
     @annotatesubrepoerror
     def files(self):
         output = self._svncommand([b'list', b'--recursive', b'--xml'])[0]
-        doc = xml.dom.minidom.parseString(output)
+        doc = xml.dom.minidom.parseString(output)  # pytype: disable=pyi-error
         paths = []
         for e in doc.getElementsByTagName('entry'):
             kind = pycompat.bytestr(e.getAttribute('kind'))