Re: [PATCH 1 of 2 v2] py3: handle meta-path finders that only use pre-python3.4 API

Ludovic Chabant ludovic at chabant.com
Tue Apr 23 23:37:17 EDT 2019


> 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?


More information about the Mercurial-devel mailing list