changeset 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 ca69e29a2a30
children 65f437c240f2
files mercurial/utils/resourceutil.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
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)