[Numpy-svn] r8140 - trunk/numpy/core

numpy-svn@scip... numpy-svn@scip...
Sat Feb 20 12:06:15 CST 2010


Author: ptvirtan
Date: 2010-02-20 12:06:15 -0600 (Sat, 20 Feb 2010)
New Revision: 8140

Modified:
   trunk/numpy/core/records.py
Log:
3K: core: fix one str/bytes issue in records.py

Modified: trunk/numpy/core/records.py
===================================================================
--- trunk/numpy/core/records.py	2010-02-20 18:06:00 UTC (rev 8139)
+++ trunk/numpy/core/records.py	2010-02-20 18:06:15 UTC (rev 8140)
@@ -44,7 +44,7 @@
 import os
 import sys
 
-from numpy.compat import isfileobj
+from numpy.compat import isfileobj, bytes
 
 ndarray = sb.ndarray
 
@@ -757,7 +757,8 @@
         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)):



More information about the Numpy-svn mailing list