From 46ec71f6bc74a0a248036b305fade5562e396c52 Mon Sep 17 00:00:00 2001 From: Matti Picus Date: Fri, 19 Nov 2021 14:51:36 +0200 Subject: ENH: provide a convenience function to replace npy_load_module (#20395) `load_module` is deprecated since python 3.4 and will be removed in python 3.12. Use `exec_module` instead. Provide a convenience function in `distutils.misc_utils` instead of `npy_load_module` from `compat.py3k`. --- numpy/compat/py3k.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'numpy/compat/py3k.py') diff --git a/numpy/compat/py3k.py b/numpy/compat/py3k.py index 1fa17621a..3d10bb988 100644 --- a/numpy/compat/py3k.py +++ b/numpy/compat/py3k.py @@ -107,7 +107,9 @@ class contextlib_nullcontext: def npy_load_module(name, fn, info=None): """ - Load a module. + Load a module. Uses ``load_module`` which will be deprecated in python + 3.12. An alternative that uses ``exec_module`` is in + numpy.distutils.misc_util.exec_mod_from_location .. versionadded:: 1.11.2 -- cgit v1.2.1