File: numpy_1.14.patch

package info (click to toggle)
python-matplotlib-venn 0.11.5-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 268 kB
  • sloc: python: 1,770; makefile: 6
file content (24 lines) | stat: -rw-r--r-- 910 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Description: Numpy 1.14 has changed its output format for str and repr,
 changing whitespace and the number of sig figs. This breaks doctests
 that include direct numpy output without formatting the values
 explicitly. 
Orgigin: https://wiki.debian.org/ContinuousIntegration/TriagingTips/numpy-1.14-doctests
Bug-Debian: https://bugs.debian.org/902516
Author: Andreas Tille <tille@debian.org>
Last-Update: Fri, 06 Jul 2018 02:51:00 +1000

--- a/matplotlib_venn/_venn2.py
+++ b/matplotlib_venn/_venn2.py
@@ -14,6 +14,12 @@ if 'py.test' in os.path.basename(sys.arg
     matplotlib.use('Agg')
 
 import numpy as np
+# Whitespace changes between numpy 1.13 and 1.14 will cause the doctests
+# to fail; when doctests are updated to 1.14 format, this can be removed.
+try:    # CRUFT
+    np.set_printoptions(legacy='1.13')
+except TypeError:
+    pass
 import warnings
 from collections import Counter