summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
authorStefan van der Walt <stefan@sun.ac.za>2007-12-30 17:32:49 +0000
committerStefan van der Walt <stefan@sun.ac.za>2007-12-30 17:32:49 +0000
commit676d5b548cfda3b4c1723df73d4e3b27720fa33c (patch)
tree3e29c988e86c5ec48893aa4cc1afd4660638fea8 /numpy/core
parentbcd679767d28c482e2e4bebf987d27b3200c6702 (diff)
downloadnumpy-676d5b548cfda3b4c1723df73d4e3b27720fa33c.tar.gz
Workaround for TemporaryFile problem under Windows.
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/tests/test_multiarray.py9
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)