Submitter | phabricator |
---|---|
Date | Dec. 18, 2019, 10:30 p.m. |
Message ID | <differential-rev-PHID-DREV-pmlyybjh2mvkawymf22c-req@mercurial-scm.org> |
Download | mbox | patch |
Permalink | /patch/43980/ |
State | Superseded |
Headers | show |
Comments
This revision is now accepted and ready to land. indygreg added a comment. indygreg accepted this revision. That's a weird error for PyOxidizer! I'm not sure why it would be happening either. REPOSITORY rHG Mercurial BRANCH default CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7701/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7701 To: martinvonz, #hg-reviewers, indygreg Cc: indygreg, mercurial-devel
This revision now requires changes to proceed. indygreg added a comment. indygreg requested changes to this revision. This patch doesn't apply cleanly. Could you please take a look @martinvonz. REPOSITORY rHG Mercurial CHANGES SINCE LAST ACTION https://phab.mercurial-scm.org/D7701/new/ REVISION DETAIL https://phab.mercurial-scm.org/D7701 To: martinvonz, #hg-reviewers, indygreg Cc: indygreg, mercurial-devel
martinvonz added a comment.
In D7701#113332 <https://phab.mercurial-scm.org/D7701#113332>, @indygreg wrote:
> This patch doesn't apply cleanly. Could you please take a look @martinvonz.
To be clear, it didn't come directly from PyOxidizer. I instrumented `resourceutil.py` to print the `ImportError` that was raised and that is what that error was.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D7701/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D7701
To: martinvonz, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel
Patch
diff --git a/mercurial/utils/resourceutil.py b/mercurial/utils/resourceutil.py --- a/mercurial/utils/resourceutil.py +++ b/mercurial/utils/resourceutil.py @@ -43,25 +43,25 @@ datapath = os.path.dirname(os.path.dirname(pycompat.fsencode(__file__))) try: - import importlib + from importlib import resources # Force loading of the resources module - importlib.resources.open_binary # pytype: disable=module-attr + resources.open_binary # pytype: disable=module-attr def open_resource(package, name): package = b'mercurial.' + package - return importlib.resources.open_binary( # pytype: disable=module-attr + return resources.open_binary( # pytype: disable=module-attr pycompat.sysstr(package), pycompat.sysstr(name) ) def list_resources(package): package = b'mercurial.' + package - for name in importlib.resources.contents(pycompat.sysstr(package)): - if importlib.resources.is_resource(pycompat.sysstr(package), name): + for name in resources.contents(pycompat.sysstr(package)): + if resources.is_resource(pycompat.sysstr(package), name): yield pycompat.sysbytes(name) -except AttributeError: +except (ImportError, AttributeError): def _package_path(package): return os.path.join(datapath, *package.split(b'.'))