diff options
| author | Ralf Gommers <ralf.gommers@gmail.com> | 2022-01-20 13:34:18 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-20 13:34:18 +0100 |
| commit | d3dcb0443a2bb34b56447eaef0e88dc99f704918 (patch) | |
| tree | 8ac272e6541e7428db2a9130ff32684ca980b7a3 /numpy/testing/_private | |
| parent | 4103281c951f1dd34dc3bdee78e17aa9cb35c721 (diff) | |
| parent | 53294562c2e4a3510cd43cff2a8e1d9f9fdbe5d2 (diff) | |
| download | numpy-d3dcb0443a2bb34b56447eaef0e88dc99f704918.tar.gz | |
Merge pull request #20831 from bwoodsend/numpy-testing-depends-on-distutils
BUG: Avoid importing numpy.distutils on import numpy.testing (#20769)
Diffstat (limited to 'numpy/testing/_private')
| -rw-r--r-- | numpy/testing/_private/extbuild.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/testing/_private/extbuild.py b/numpy/testing/_private/extbuild.py index 940e2f7d7..b7a071e7f 100644 --- a/numpy/testing/_private/extbuild.py +++ b/numpy/testing/_private/extbuild.py @@ -8,8 +8,6 @@ import os import pathlib import sys import sysconfig -from numpy.distutils.ccompiler import new_compiler -from distutils.errors import CompileError __all__ = ['build_and_import_extension', 'compile_extension_module'] @@ -53,6 +51,7 @@ def build_and_import_extension( >>> assert not mod.test_bytes(u'abc') >>> assert mod.test_bytes(b'abc') """ + from distutils.errors import CompileError body = prologue + _make_methods(functions, modname) init = """PyObject *mod = PyModule_Create(&moduledef); @@ -221,6 +220,7 @@ def _c_compile(cfile, outputfilename, include_dirs=[], libraries=[], def build(cfile, outputfilename, compile_extra, link_extra, include_dirs, libraries, library_dirs): "cd into the directory where the cfile is, use distutils to build" + from numpy.distutils.ccompiler import new_compiler compiler = new_compiler(force=1, verbose=2) compiler.customize('') |
