Skip to content

imp is deprecated #479

@ghost

Description

Originally reported by: jaraco (Bitbucket: jaraco, GitHub: jaraco)


According to the docs, imp is deprecated since Python 3.4. Yet pkg_resources relies on it. In particular, it relies on the acquire_lock and release_lock functions, which don't have an equivalent in importlib.

The docs do say, "Changed in version 3.3: The locking scheme has changed to per-module locks for the most part. A global import lock is kept for some critical tasks, such as initializing the per-module locks."

What does that mean for the usage in pkg_resources? Is it possible to eliminate the usage of locks on Python 3.3+ in declare_namespace and fixup_namespace_packages?

This issue was revealed in Pull Request 129, but the resolution was to keep it and the deprecation warnings. What's the proper solution here?


Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs ImplementationIssues that are ready to be implemented.Needs InvestigationIssues which are likely in scope but need investigation to figure out the causebughelp wantedmajor

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions