[Updated] D11311: resources: stop important a non existent FileNotFoundError

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Sun Aug 22 20:37:07 UTC 2021


Closed by commit rHGdf94c13ddf60: resources: stop important a non existent FileNotFoundError (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11311?vs=29960&id=29984

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11311/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D11311

AFFECTED FILES
  mercurial/utils/resourceutil.py

CHANGE DETAILS

diff --git a/mercurial/utils/resourceutil.py b/mercurial/utils/resourceutil.py
--- a/mercurial/utils/resourceutil.py
+++ b/mercurial/utils/resourceutil.py
@@ -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")



To: marmoute, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210822/8d4f408b/attachment-0002.html>


More information about the Mercurial-patches mailing list