pytype: work around wrong ImportError flagging
authorRaphaël Gomès <rgomes@octobus.net>
Thu, 18 Jul 2024 12:03:29 +0200
changeset 51702 b0a4de6c14f8
parent 51701 97d013f48cae
child 51703 ca7bde5dbafb
pytype: work around wrong ImportError flagging As documented in https://github.com/google/pytype/issues/163, newer versions of Pytype do not understand caught `ImportError`, so we temporarily ignore them where applicable.
mercurial/chgserver.py
mercurial/policy.py
mercurial/util.py
--- a/mercurial/chgserver.py	Thu Jul 18 12:02:01 2024 +0200
+++ b/mercurial/chgserver.py	Thu Jul 18 12:03:29 2024 +0200
@@ -151,7 +151,7 @@
     """
     modules = [m for n, m in extensions.extensions(ui)]
     try:
-        from . import __version__
+        from . import __version__  # type: ignore
 
         modules.append(__version__)
     except ImportError:
--- a/mercurial/policy.py	Thu Jul 18 12:02:01 2024 +0200
+++ b/mercurial/policy.py	Thu Jul 18 12:03:29 2024 +0200
@@ -37,7 +37,7 @@
 }
 
 try:
-    from . import __modulepolicy__
+    from . import __modulepolicy__  # type: ignore
 
     policy = __modulepolicy__.modulepolicy
 except ImportError:
--- a/mercurial/util.py	Thu Jul 18 12:02:01 2024 +0200
+++ b/mercurial/util.py	Thu Jul 18 12:03:29 2024 +0200
@@ -1152,7 +1152,7 @@
 def version():
     """Return version information if available."""
     try:
-        from . import __version__
+        from . import __version__  # type: ignore
 
         return __version__.version
     except ImportError: