Skip to content

Commit 33d2698

Browse files
committed
revert use of importlib in interfaces __init__
1 parent a8169a5 commit 33d2698

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

mkl_fft/interfaces/__init__.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,25 @@
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+
33+
_has_scipy = True
34+
except ImportError:
35+
_has_scipy = False
3436

3537
if _has_scipy:
36-
if not _has_mkl_service:
38+
try:
39+
import mkl
40+
41+
from . import scipy_fft
42+
except ImportError:
3743
pass
3844
else:
39-
from . import scipy_fft
40-
4145
__all__.append("scipy_fft")
4246

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

0 commit comments

Comments
 (0)