D10205: typing: disable a few errors calling py3.7+ functions in resourceutil.py
mharbison72 (Matt Harbison)
phabricator at mercurial-scm.org
Sat Mar 13 19:33:39 UTC 2021
mharbison72 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.
REVISION SUMMARY
There's a graceful fallback when these methods are unavailable.
REPOSITORY
rHG Mercurial
BRANCH
stable
REVISION DETAIL
https://phab.mercurial-scm.org/D10205
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
@@ -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)
To: mharbison72, #hg-reviewers
Cc: mercurial-patches, mercurial-devel
More information about the Mercurial-devel
mailing list