typing: disable import error warnings that are already handled stable
authorMatt Harbison <matt_harbison@yahoo.com>
Sat, 13 Mar 2021 00:38:59 -0500
branchstable
changeset 46413 521ac0d7047f
parent 46412 65f437c240f2
child 46414 52528570312e
typing: disable import error warnings that are already handled I'm assuming that the cffi ones are handled somewhere, but the others definitely are. Differential Revision: https://phab.mercurial-scm.org/D10207
mercurial/cffi/bdiff.py
mercurial/cffi/mpatch.py
mercurial/cffi/osutil.py
mercurial/debugcommands.py
mercurial/sslutil.py
mercurial/testing/revlog.py
mercurial/urllibcompat.py
mercurial/utils/hashutil.py
--- a/mercurial/cffi/bdiff.py	Fri Mar 12 17:22:35 2021 -0500
+++ b/mercurial/cffi/bdiff.py	Sat Mar 13 00:38:59 2021 -0500
@@ -10,7 +10,7 @@
 import struct
 
 from ..pure.bdiff import *
-from . import _bdiff
+from . import _bdiff  # pytype: disable=import-error
 
 ffi = _bdiff.ffi
 lib = _bdiff.lib
--- a/mercurial/cffi/mpatch.py	Fri Mar 12 17:22:35 2021 -0500
+++ b/mercurial/cffi/mpatch.py	Sat Mar 13 00:38:59 2021 -0500
@@ -9,7 +9,7 @@
 
 from ..pure.mpatch import *
 from ..pure.mpatch import mpatchError  # silence pyflakes
-from . import _mpatch
+from . import _mpatch  # pytype: disable=import-error
 
 ffi = _mpatch.ffi
 lib = _mpatch.lib
--- a/mercurial/cffi/osutil.py	Fri Mar 12 17:22:35 2021 -0500
+++ b/mercurial/cffi/osutil.py	Sat Mar 13 00:38:59 2021 -0500
@@ -15,7 +15,7 @@
 from .. import pycompat
 
 if pycompat.isdarwin:
-    from . import _osutil
+    from . import _osutil  # pytype: disable=import-error
 
     ffi = _osutil.ffi
     lib = _osutil.lib
--- a/mercurial/debugcommands.py	Fri Mar 12 17:22:35 2021 -0500
+++ b/mercurial/debugcommands.py	Sat Mar 13 00:38:59 2021 -0500
@@ -1622,7 +1622,7 @@
     )
 
     try:
-        from . import rustext
+        from . import rustext  # pytype: disable=import-error
 
         rustext.__doc__  # trigger lazy import
     except ImportError:
--- a/mercurial/sslutil.py	Fri Mar 12 17:22:35 2021 -0500
+++ b/mercurial/sslutil.py	Sat Mar 13 00:38:59 2021 -0500
@@ -269,7 +269,7 @@
 
     if b'SSLKEYLOGFILE' in encoding.environ:
         try:
-            import sslkeylog
+            import sslkeylog  # pytype: disable=import-error
 
             sslkeylog.set_keylog(
                 pycompat.fsdecode(encoding.environ[b'SSLKEYLOGFILE'])
--- a/mercurial/testing/revlog.py	Fri Mar 12 17:22:35 2021 -0500
+++ b/mercurial/testing/revlog.py	Sat Mar 13 00:38:59 2021 -0500
@@ -24,7 +24,7 @@
 
 
 try:
-    from ..cext import parsers as cparsers
+    from ..cext import parsers as cparsers  # pytype: disable=import-error
 except ImportError:
     cparsers = None
 
--- a/mercurial/urllibcompat.py	Fri Mar 12 17:22:35 2021 -0500
+++ b/mercurial/urllibcompat.py	Sat Mar 13 00:38:59 2021 -0500
@@ -148,6 +148,7 @@
 
 
 else:
+    # pytype: disable=import-error
     import BaseHTTPServer
     import CGIHTTPServer
     import SimpleHTTPServer
@@ -155,6 +156,8 @@
     import urllib
     import urlparse
 
+    # pytype: enable=import-error
+
     urlreq._registeraliases(
         urllib,
         (
--- a/mercurial/utils/hashutil.py	Fri Mar 12 17:22:35 2021 -0500
+++ b/mercurial/utils/hashutil.py	Sat Mar 13 00:38:59 2021 -0500
@@ -3,7 +3,7 @@
 import hashlib
 
 try:
-    from ..thirdparty import sha1dc
+    from ..thirdparty import sha1dc  # pytype: disable=import-error
 
     sha1 = sha1dc.sha1
 except (ImportError, AttributeError):