# HG changeset patch # User Raphaël Gomès # Date 2024-07-18 10:03:29 # Node ID b0a4de6c14f8c3d6f117a29d23379970a66e2b70 # Parent 97d013f48cae39f98822d6c413ea3e12d15389c1 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. diff --git a/mercurial/chgserver.py b/mercurial/chgserver.py --- a/mercurial/chgserver.py +++ b/mercurial/chgserver.py @@ -151,7 +151,7 @@ def _getmtimepaths(ui): """ modules = [m for n, m in extensions.extensions(ui)] try: - from . import __version__ + from . import __version__ # type: ignore modules.append(__version__) except ImportError: diff --git a/mercurial/policy.py b/mercurial/policy.py --- a/mercurial/policy.py +++ b/mercurial/policy.py @@ -37,7 +37,7 @@ policy = b'allow' } try: - from . import __modulepolicy__ + from . import __modulepolicy__ # type: ignore policy = __modulepolicy__.modulepolicy except ImportError: diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -1152,7 +1152,7 @@ def makeloggingsocket( def version(): """Return version information if available.""" try: - from . import __version__ + from . import __version__ # type: ignore return __version__.version except ImportError: