D7681: pytype: suppress warnings about no 'open_binary' on importlib.resources

mharbison72 (Matt Harbison) phabricator at mercurial-scm.org
Tue Dec 17 04:46:33 UTC 2019


mharbison72 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Fixes these pytype warnings:
  
    line 43, in <module>: No attribute 'open_binary' on module 'importlib.resources' [module-attr]
    line 47, in open_resource: No attribute 'open_binary' on module 'importlib.resources' [module-attr]
  
  For some reason, I can't upgrade from 3.6.8 in my WSL environment.

REPOSITORY
  rHG Mercurial

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

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
@@ -40,11 +40,11 @@
     import importlib
 
     # Force loading of the resources module
-    importlib.resources.open_binary
+    importlib.resources.open_binary  # pytype: disable=module-attr
 
     def open_resource(package, name):
         package = b'mercurial.' + package
-        return importlib.resources.open_binary(
+        return importlib.resources.open_binary(  # pytype: disable=module-attr
             pycompat.sysstr(package), pycompat.sysstr(name)
         )
 



To: mharbison72, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list