From 1cca89022b16788170c015675f5bdc2899ac1168 Mon Sep 17 00:00:00 2001
From: Jonathan Helmus <jjhelmus@gmail.com>
Date: Fri, 1 Mar 2019 12:33:56 -0600
Subject: [PATCH 18/18] filter out warnings when importing mkl_fft

Filter out harmless Cython warnings when importing mkl_fft.  These filter are
set globally when importing numpy but have not yet been set when importing from
the fft folder.
---
 numpy/fft/__init__.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/numpy/fft/__init__.py b/numpy/fft/__init__.py
index 8298307..9b99d88 100644
--- a/numpy/fft/__init__.py
+++ b/numpy/fft/__init__.py
@@ -12,9 +12,15 @@ del PytestTester
 
 
 try:
-    import mkl_fft._numpy_fft as _nfft
-    patch_fft = True
-    __patched_functions__ = _nfft.__all__
+    import warnings
+    with warnings.catch_warnings():
+        # Filter out harmless Cython warnings coming from mkl_fft
+        warnings.filterwarnings("ignore", message="numpy.dtype size changed")
+        warnings.filterwarnings("ignore", message="numpy.ufunc size changed")
+        warnings.filterwarnings("ignore", message="numpy.ndarray size changed")
+        import mkl_fft._numpy_fft as _nfft
+        patch_fft = True
+        __patched_functions__ = _nfft.__all__
 except ImportError:
     patch_fft = False
 
-- 
2.7.4

