diff options
author | Stefan van der Walt <stefan@sun.ac.za> | 2007-12-30 17:32:49 +0000 |
---|---|---|
committer | Stefan van der Walt <stefan@sun.ac.za> | 2007-12-30 17:32:49 +0000 |
commit | 676d5b548cfda3b4c1723df73d4e3b27720fa33c (patch) | |
tree | 3e29c988e86c5ec48893aa4cc1afd4660638fea8 /numpy/core | |
parent | bcd679767d28c482e2e4bebf987d27b3200c6702 (diff) | |
download | numpy-676d5b548cfda3b4c1723df73d4e3b27720fa33c.tar.gz |
Workaround for TemporaryFile problem under Windows.
Diffstat (limited to 'numpy/core')
-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) |