resource finder looking at wrong module

Create issue
Issue #87 resolved
Steve Dower created an issue

In resources.py the following code exists:

try:
    import _frozen_importlib
    _finder_registry[_frozen_importlib.SourceFileLoader] = ResourceFinder
    _finder_registry[_frozen_importlib.FileFinder] = ResourceFinder
except (ImportError, AttributeError):
    pass

In Python 3.6.0b1, these types need to come from _frozen_importlib_external. Otherwise, creating scripts fails on Windows.

Comments (3)

  1. Steve Dower reporter

    I'm not set up to quickly do a PR for this project, but here's how I fixed it locally:

    try:
        import _frozen_importlib
        _finder_registry[_frozen_importlib.SourceFileLoader] = ResourceFinder
        _finder_registry[_frozen_importlib.FileFinder] = ResourceFinder
    except (ImportError, AttributeError):
        try:
            import _frozen_importlib_external
            _finder_registry[_frozen_importlib_external.SourceFileLoader] = ResourceFinder
            _finder_registry[_frozen_importlib_external.FileFinder] = ResourceFinder
        except (ImportError, AttributeError):
            pass
    
  2. Log in to comment