diff options
Diffstat (limited to 'numpy/dual.py')
-rw-r--r-- | numpy/dual.py | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/numpy/dual.py b/numpy/dual.py index 32baa020e..2a5e0e101 100644 --- a/numpy/dual.py +++ b/numpy/dual.py @@ -7,19 +7,26 @@ __all__ = ['fft','ifft','fftn','ifftn','fft2','ifft2', 'inv','svd','solve','det','eig','eigvals','lstsq', 'pinv','cholesky','i0'] -try: - import scipy.linalg as linpkg -except ImportError: - import numpy.linalg as linpkg +# First check to see that scipy is "new" scipy +# Perhaps we could check to see if the functions actually work in +# the scipy that will be imported. + +have_scipy = 0 try: - import scipy.fftpack as fftpkg + import scipy + if scipy.__version__ >= '0.4.4': + have_scipy = 1 except ImportError: - import numpy.dft as fftpkg + pass -try: +if have_scipy: + import scipy.linalg as linpkg + import scipy.fftpack as fftpkg from scipy.special import i0 -except ImportError: +else: + import numpy.linalg as linpkg + import numpy.dft as fftpkg from numpy.lib import i0 fft = fftpkg.fft |