This is an archive of the discontinued Mercurial Phabricator instance.

resourceutil: use `from importlib import resources`
ClosedPublic

Authored by martinvonz on Dec 18 2019, 5:30 PM.

Details

Summary

Without this patch, we get the following error from when trying to run
hg with PyOxidizer:

module 'importlib' has no attribute 'resources'

I don't know what why that happens, but `from importlib import
resources` is the form I would prefer anyway, so let's use that now
that the impoort-checker has been fixed.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

martinvonz created this revision.Dec 18 2019, 5:30 PM
indygreg accepted this revision.Dec 18 2019, 9:04 PM
indygreg added a subscriber: indygreg.

That's a weird error for PyOxidizer! I'm not sure why it would be happening either.

This revision is now accepted and ready to land.Dec 18 2019, 9:04 PM
indygreg requested changes to this revision.Dec 18 2019, 9:06 PM

This patch doesn't apply cleanly. Could you please take a look @martinvonz.

This revision now requires changes to proceed.Dec 18 2019, 9:06 PM

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.

indygreg accepted this revision.Dec 23 2019, 12:17 PM
This revision is now accepted and ready to land.Dec 23 2019, 12:17 PM
This revision was automatically updated to reflect the committed changes.