diff mercurial/utils/resourceutil.py @ 46411:7fd369644c68 stable

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
author Matt Harbison <matt_harbison@yahoo.com>
date Fri, 12 Mar 2021 16:55:18 -0500
parents dd9e28612468
children d4ba4d51f85f
line wrap: on
line diff
--- 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)