diff options
Diffstat (limited to 'numpy/lib/format.py')
-rw-r--r-- | numpy/lib/format.py | 6 |
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: |