summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/lib/npyio.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
index 7d561a393..6873a4785 100644
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -1002,7 +1002,7 @@ def savetxt(fname, X, fmt='%.18e', delimiter=' ', newline='\n', header='',
fh = open(fname, 'wb')
else:
fh = open(fname, 'w')
- elif hasattr(fname, 'seek'):
+ elif hasattr(fname, 'write'):
fh = fname
else:
raise ValueError('fname must be a string or file handle')