FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Merge pull request #20906 from charris/backport-20831 · numpy/numpy@cb69266 · GitHub

/ numpy Public

Commit cb69266

Browse files
authored
Merge pull request #20906 from charris/backport-20831
BUG: Avoid importing numpy.distutils on import numpy.testing
2 parents a62fb25 + 5d4acac commit cb69266

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎numpy/testing/_private/extbuild.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
import pathlib
99
import sys
1010
import sysconfig
11-
from numpy.distutils.ccompiler import new_compiler
12-
from distutils.errors import CompileError
1311

1412
__all__ = ['build_and_import_extension', 'compile_extension_module']
1513

@@ -53,6 +51,7 @@ def build_and_import_extension(
5351
>>> assert not mod.test_bytes(u'abc')
5452
>>> assert mod.test_bytes(b'abc')
5553
"""
54+
from distutils.errors import CompileError
5655

5756
body = prologue + _make_methods(functions, modname)
5857
init = """PyObject *mod = PyModule_Create(&moduledef);
@@ -221,6 +220,7 @@ def _c_compile(cfile, outputfilename, include_dirs=[], libraries=[],
221220
def build(cfile, outputfilename, compile_extra, link_extra,
222221
include_dirs, libraries, library_dirs):
223222
"cd into the directory where the cfile is, use distutils to build"
223+
from numpy.distutils.ccompiler import new_compiler
224224

225225
compiler = new_compiler(force=1, verbose=2)
226226
compiler.customize('')

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL