typing: disable a few errors calling py3.7+ functions in resourceutil.py stable
authorMatt Harbison <matt_harbison@yahoo.com>
Fri, 12 Mar 2021 16:55:18 -0500
branchstable
changeset 46783 7fd369644c68
parent 46703 ca69e29a2a30
child 46784 65f437c240f2
typing: disable a few errors calling py3.7+ functions in resourceutil.py There's a graceful fallback when these methods are unavailable. Differential Revision: https://phab.mercurial-scm.org/D10205
mercurial/utils/resourceutil.py
--- a/mercurial/utils/resourceutil.py	Wed Mar 17 12:06:49 2021 +0100
+++ b/mercurial/utils/resourceutil.py	Fri Mar 12 16:55:18 2021 -0500
@@ -70,12 +70,14 @@
         )
 
     def is_resource(package, name):
-        return resources.is_resource(
+        return resources.is_resource(  # pytype: disable=module-attr
             pycompat.sysstr(package), encoding.strfromlocal(name)
         )
 
     def contents(package):
+        # pytype: disable=module-attr
         for r in resources.contents(pycompat.sysstr(package)):
+            # pytype: enable=module-attr
             yield encoding.strtolocal(r)