From 56f03d35bd89d5f8f6923dff24afbbb3e3dc0ebe Mon Sep 17 00:00:00 2001
From: Stefan Behnel <stefan_ml@behnel.de>
Date: Sat, 17 Feb 2018 08:44:07 +0100
Subject: [PATCH] Fix doctest issue due to different array display in NumPy
 1.14.

---
 tests/run/numpy_test.pyx | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/tests/run/numpy_test.pyx b/tests/run/numpy_test.pyx
index 452e44f74..9b6ec518d 100644
--- a/tests/run/numpy_test.pyx
+++ b/tests/run/numpy_test.pyx
@@ -43,14 +43,14 @@ try:
     2 0 9 5
 
     >>> three_dim()  # doctest: +NORMALIZE_WHITESPACE
-    [[[  0.   1.   2.   3.]
-      [  4.   5.   6.   7.]]
-    <_BLANKLINE_>
-     [[  8.   9.  10.  11.]
-      [ 12.  13.  14.  15.]]
-    <_BLANKLINE_>
-     [[ 16.  17.  18.  19.]
-      [ 20.  21.  22.  23.]]]
+    [[[0.   1.   2.   3.]
+      [4.   5.   6.   7.]]
+    <BLANKLINE>
+     [[8.   9.  10.  11.]
+      [12.  13.  14.  15.]]
+    <BLANKLINE>
+     [[16.  17.  18.  19.]
+      [20.  21.  22.  23.]]]
     6.0 0.0 13.0 8.0
 
     >>> obj_array()
@@ -286,10 +286,9 @@ def assert_dtype_sizes():
 
 def ndarray_str(arr):
     u"""
-    Since Py2.3 doctest don't support <BLANKLINE>, manually replace blank lines
-    with <_BLANKLINE_>
+    Work around display differences in NumPy 1.14.
     """
-    return unicode(arr).replace(u'\n\n', u'\n<_BLANKLINE_>\n')
+    return re.sub(ur'\[ +', '[', unicode(arr))
 
 def basic():
     cdef object[int, ndim=2] buf = np.arange(10, dtype='i').reshape((2, 5))
-- 
2.30.9