summaryrefslogtreecommitdiff
path: root/numpy/distutils/ccompiler_opt.py
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2021-11-19 14:51:36 +0200
committerGitHub <noreply@github.com>2021-11-19 07:51:36 -0500
commit46ec71f6bc74a0a248036b305fade5562e396c52 (patch)
treefbcdee4e3a86f8fcdfbee6269218fff01826a8c6 /numpy/distutils/ccompiler_opt.py
parent3774a620f79c069173d2567f09a9760f8ba0d564 (diff)
downloadnumpy-46ec71f6bc74a0a248036b305fade5562e396c52.tar.gz
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`.
Diffstat (limited to 'numpy/distutils/ccompiler_opt.py')
-rw-r--r--numpy/distutils/ccompiler_opt.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/distutils/ccompiler_opt.py b/numpy/distutils/ccompiler_opt.py
index 39847c20f..b38e47c13 100644
--- a/numpy/distutils/ccompiler_opt.py
+++ b/numpy/distutils/ccompiler_opt.py
@@ -654,9 +654,9 @@ class _Distutils:
@staticmethod
def dist_load_module(name, path):
"""Load a module from file, required by the abstract class '_Cache'."""
- from numpy.compat import npy_load_module
+ from .misc_util import exec_mod_from_location
try:
- return npy_load_module(name, path)
+ return exec_mod_from_location(name, path)
except Exception as e:
_Distutils.dist_log(e, stderr=True)
return None