diff options
-rw-r--r-- | numpy/core/tests/test_multiarray.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py index 777cf2893..a6d669d25 100644 --- a/numpy/core/tests/test_multiarray.py +++ b/numpy/core/tests/test_multiarray.py @@ -499,7 +499,14 @@ class TestFromToFile(NumpyTestCase): self.dtype = np.complex def test_file(self): - f = tempfile.TemporaryFile() + # Python under Windows does not believe that TemporaryFile + # is an open file + if sys.platform.startswith('win'): + filename = tempfile.mktemp() + f = open(filename,'wb') + else: + f = tempfile.TemporaryFile() + self.x.tofile(f) f.seek(0) y = np.fromfile(f,dtype=self.dtype) |