| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,8 +8,6 @@ | |||
| 8 | 8 | import pathlib | |
| 9 | 9 | import sys | |
| 10 | 10 | import sysconfig | |
| 11 | - from numpy.distutils.ccompiler import new_compiler | ||
| 12 | - from distutils.errors import CompileError | ||
| 13 | 11 | ||
| 14 | 12 | __all__ = ['build_and_import_extension', 'compile_extension_module'] | |
| 15 | 13 | ||
@@ -53,6 +51,7 @@ def build_and_import_extension( | |||
| 53 | 51 | >>> assert not mod.test_bytes(u'abc') | |
| 54 | 52 | >>> assert mod.test_bytes(b'abc') | |
| 55 | 53 | """ | |
| 54 | + from distutils.errors import CompileError | ||
| 56 | 55 | ||
| 57 | 56 | body = prologue + _make_methods(functions, modname) | |
| 58 | 57 | init = """PyObject *mod = PyModule_Create(&moduledef); | |
@@ -221,6 +220,7 @@ def _c_compile(cfile, outputfilename, include_dirs=[], libraries=[], | |||
| 221 | 220 | def build(cfile, outputfilename, compile_extra, link_extra, | |
| 222 | 221 | include_dirs, libraries, library_dirs): | |
| 223 | 222 | "cd into the directory where the cfile is, use distutils to build" | |
| 223 | + from numpy.distutils.ccompiler import new_compiler | ||
| 224 | 224 | ||
| 225 | 225 | compiler = new_compiler(force=1, verbose=2) | |
| 226 | 226 | compiler.customize('') | |
| Back | FazBrowse Home | New Git URL |
0 commit comments