Thanks to visit codestin.com Credit goes to github.com
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.
1 parent 656c88f commit 34e0422Copy full SHA for 34e0422
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