diff options
author | Pauli Virtanen <pav@iki.fi> | 2010-02-20 18:06:15 +0000 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2010-02-20 18:06:15 +0000 |
commit | 02aeb9bdd0411f0119cfbdb9456a37cdd2d4cc02 (patch) | |
tree | e3d034974486352669608ff1eb3f91e9784446e3 | |
parent | fdf9d7fa476c4717028ea424b0a96fc027dc9971 (diff) | |
download | numpy-02aeb9bdd0411f0119cfbdb9456a37cdd2d4cc02.tar.gz |
3K: core: fix one str/bytes issue in records.py
-rw-r--r-- | numpy/core/records.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/numpy/core/records.py b/numpy/core/records.py index 77c8968f1..2afb89f81 100644 --- a/numpy/core/records.py +++ b/numpy/core/records.py @@ -44,7 +44,7 @@ import types import os import sys -from numpy.compat import isfileobj +from numpy.compat import isfileobj, bytes ndarray = sb.ndarray @@ -757,7 +757,8 @@ def array(obj, dtype=None, shape=None, offset=0, strides=None, formats=None, if shape is None: raise ValueError("Must define a shape if obj is None") return recarray(shape, dtype, buf=obj, offset=offset, strides=strides) - elif isinstance(obj, str): + + elif isinstance(obj, bytes): return fromstring(obj, dtype, shape=shape, offset=offset, **kwds) elif isinstance(obj, (list, tuple)): |