[PATCH 1 of 2 v2] py3: handle meta-path finders that only use pre-python3.4 API
gregory.szorc at gmail.com
Wed Apr 24 22:11:12 EDT 2019
On Wed, Apr 24, 2019 at 4:28 PM Yuya Nishihara <yuya at tcha.org> wrote:
> On Tue, 23 Apr 2019 23:37:17 -0400, Ludovic Chabant wrote:
> > > Does find_module() return a spec? We might instead have to skip py3.4
> > > finders.
> > Ah you're right, it returns something else. It looks like Python
> > does this:
> > try:
> > find_spec = finder.find_spec
> > except AttributeError:
> > loader = finder.find_module(name)
> > if loader is None:
> > return None
> > return importlib.util.spec_from_loader(name, loader)
> > else:
> > return find_spec(name)
> > We can either emulate the same logic, or just skip old finders?
> No idea. Do we have to support unknown finders?
We don't *need* to support unknown finders. But if we ignore them, we run
the risk that they are provided functionality necessary for running
Mercurial. e.g. a zip import finder may be necessary to find the Mercurial
source/bytecode data. This is the problem with the source transforming
module importer: it only works if things are reasonably "normal."
Since we want to remove the source transforming module importer, I'm fine
doing something less than ideal for now in the name of furthering Python 3
support faster. Hopefully all this code is deleted before Python 3 support
is stable and we won't have anything to worry about.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mercurial-devel