# HG changeset patch # User Raphaël Gomès # Date 1721297009 -7200 # Node ID 39e2b2d062c1f2e404acc133bc33f6106205aa59 # Parent 25e7f9dcad0f54914f7bff176b0f6be1e22937e1 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 -r 25e7f9dcad0f -r 39e2b2d062c1 mercurial/chgserver.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: diff -r 25e7f9dcad0f -r 39e2b2d062c1 mercurial/policy.py --- 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: diff -r 25e7f9dcad0f -r 39e2b2d062c1 mercurial/util.py --- 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: