We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9576473 + dcbb16d commit c74ca21Copy full SHA for c74ca21
lib/matplotlib/tests/test_mlab.py
@@ -1,4 +1,7 @@
1
from __future__ import print_function
2
+
3
+import sys
4
5
import numpy as np
6
import matplotlib.mlab as mlab
7
import tempfile
@@ -19,7 +22,10 @@ def test_recarray_csv_roundtrip():
19
22
expected['x'][:] = np.linspace(-1e9, -1, 99)
20
23
expected['y'][:] = np.linspace(1, 1e9, 99)
21
24
expected['t'][:] = np.linspace(0, 0.01, 99)
- fd = tempfile.TemporaryFile(suffix='csv', mode="w+")
25
+ if sys.version_info[0] == 2:
26
+ fd = tempfile.TemporaryFile(suffix='csv', mode="wb+")
27
+ else:
28
+ fd = tempfile.TemporaryFile(suffix='csv', mode="w+", newline='')
29
mlab.rec2csv(expected,fd)
30
fd.seek(0)
31
actual = mlab.csv2rec(fd)
0 commit comments