Skip to content

Commit 514c799

Browse files
committed
revert use of importlib in interfaces __init__
1 parent a8169a5 commit 514c799

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

mkl_fft/interfaces/__init__.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,23 @@
2323
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2424
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2525

26-
import importlib.util
27-
2826
from . import numpy_fft
2927

3028
__all__ = ["numpy_fft"]
3129

32-
_has_scipy = importlib.util.find_spec("scipy") is not None
33-
_has_mkl_service = importlib.util.find_spec("mkl") is not None
30+
try:
31+
import scipy
32+
_has_scipy = True
33+
except ImportError:
34+
_has_scipy = False
3435

3536
if _has_scipy:
36-
if not _has_mkl_service:
37+
try:
38+
import mkl
39+
from . import scipy_fft
40+
except ImportError:
3741
pass
3842
else:
39-
from . import scipy_fft
40-
4143
__all__.append("scipy_fft")
4244

43-
del importlib, _has_scipy, _has_mkl_service
45+
del _has_scipy

0 commit comments

Comments
 (0)