Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-26131: deprecate the use of load_module() #22905

Closed
wants to merge 4 commits into from

Conversation

brettcannon
Copy link
Member

@brettcannon brettcannon commented Oct 23, 2020

Deprecating the use of load_module() requires two parts:

  1. The actual load_module() implementations are deprecated.
  2. Use of load_module() as a fallback for exec_module() trigger an ImportWarning.

This makes sure that either direct use of the method or indirect use by the import system raises some warning.

The method itself has been documented as deprecated since Python 3.6 and has been superceded by exec_module().

https://bugs.python.org/issue26131

Copy link
Member

@warsaw warsaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One suggestion. There are also test failures.

Lib/importlib/_bootstrap.py Outdated Show resolved Hide resolved
@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

@brettcannon
Copy link
Member Author

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@warsaw: please review the changes made to this pull request.

@brettcannon
Copy link
Member Author

This is going to require implementing exec_module() for zipimport.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants