bpo-26131: deprecate the use of load_module() by brettcannon · Pull Request #22905 · python/cpython (original) (raw)
Deprecating the use of load_module() requires two parts:
- The actual
load_module()implementations are deprecated. - Use of
load_module()as a fallback forexec_module()trigger anImportWarning.
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().