summaryrefslogtreecommitdiff
path: root/numpy/lib/format.py
diff options
context:
space:
mode:
authorPauli Virtanen <pav@iki.fi>2009-12-06 12:10:42 +0000
committerPauli Virtanen <pav@iki.fi>2009-12-06 12:10:42 +0000
commita0ef94ef124d29c273ac7524f81458d118daf2c1 (patch)
treec33d59715926a10dea3ec7ce5c4834f0b8811506 /numpy/lib/format.py
parent906d21e1b3ef6e6cd68847c427c185137a151314 (diff)
downloadnumpy-a0ef94ef124d29c273ac7524f81458d118daf2c1.tar.gz
3K: rename compat.isfile to isfileobj to avoid confusion with os.path
Diffstat (limited to 'numpy/lib/format.py')
-rw-r--r--numpy/lib/format.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/lib/format.py b/numpy/lib/format.py
index 0c9d79bb3..a28108f5f 100644
--- a/numpy/lib/format.py
+++ b/numpy/lib/format.py
@@ -139,7 +139,7 @@ import cPickle
import numpy
from numpy.lib.utils import safe_eval
-from numpy.compat import asbytes, isfile
+from numpy.compat import asbytes, isfileobj
MAGIC_PREFIX = '\x93NUMPY'
MAGIC_LEN = len(MAGIC_PREFIX) + 2
@@ -397,7 +397,7 @@ def write_array(fp, array, version=(1,0)):
# handle Fortran-contiguous arrays.
fp.write(array.data)
else:
- if isfile(fp):
+ if isfileobj(fp):
array.tofile(fp)
else:
# XXX: We could probably chunk this using something like
@@ -440,7 +440,7 @@ def read_array(fp):
# The array contained Python objects. We need to unpickle the data.
array = cPickle.load(fp)
else:
- if isfile(fp):
+ if isfileobj(fp):
# We can use the fast fromfile() function.
array = numpy.fromfile(fp, dtype=dtype, count=count)
else: