Mercurial > hg
changeset 47858:df94c13ddf60 stable
resources: stop important a non existent FileNotFoundError
The error was hidden by the wide try/except
Differential Revision: https://phab.mercurial-scm.org/D11311
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 19 Aug 2021 17:47:27 +0200 |
parents | 2b76255a4f74 |
children | 155a2ec8a9dc 16346f3d446d |
files | mercurial/utils/resourceutil.py |
diffstat | 1 files changed, 0 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/utils/resourceutil.py Thu Aug 19 17:46:46 2021 +0200 +++ b/mercurial/utils/resourceutil.py Thu Aug 19 17:47:27 2021 +0200 @@ -64,11 +64,6 @@ # Force loading of the resources module resources.open_binary # pytype: disable=module-attr - # pytype: disable=import-error - from importlib.resources import FileNotFoundError - - # pytype: enable=import-error - def open_resource(package, name): return resources.open_binary( # pytype: disable=module-attr pycompat.sysstr(package), pycompat.sysstr(name) @@ -90,9 +85,6 @@ # importlib.resources was not found (almost definitely because we're on a # Python version before 3.7) - class FileNotFoundError(RuntimeError): - pass - def open_resource(package, name): path = os.path.join(_package_path(package), name) return open(path, "rb")