From a0ef94ef124d29c273ac7524f81458d118daf2c1 Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sun, 6 Dec 2009 12:10:42 +0000 Subject: 3K: rename compat.isfile to isfileobj to avoid confusion with os.path --- numpy/lib/format.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'numpy/lib/format.py') 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: -- cgit v1.2.1