# HG changeset patch # User Martin von Zweigbergk # Date 2020-09-12 18:18:12 # Node ID dd9e286124681ba027c2df853ec8d71e2b90a8c1 # Parent e53a3d0ef416e3b7c5538457da33cc4c0a22cb75 resourceutil: document when we expect to take the importlib.resouces code path Differential Revision: https://phab.mercurial-scm.org/D9018 diff --git a/mercurial/utils/resourceutil.py b/mercurial/utils/resourceutil.py --- a/mercurial/utils/resourceutil.py +++ b/mercurial/utils/resourceutil.py @@ -55,6 +55,8 @@ else: try: + # importlib.resources exists from Python 3.7; see fallback in except clause + # further down from importlib import resources from .. import encoding @@ -78,6 +80,8 @@ try: except (ImportError, AttributeError): + # importlib.resources was not found (almost definitely because we're on a + # Python version before 3.7) def open_resource(package, name): path = os.path.join(_package_path(package), name)