[Numpy-svn] r8145 - trunk/numpy/core/src/multiarray

numpy-svn@scip... numpy-svn@scip...
Sat Feb 20 12:07:43 CST 2010


Author: ptvirtan
Date: 2010-02-20 12:07:43 -0600 (Sat, 20 Feb 2010)
New Revision: 8145

Modified:
   trunk/numpy/core/src/multiarray/arraytypes.c.src
Log:
3K: ENH: core: audit some PyString -> PyBytes conversions

Modified: trunk/numpy/core/src/multiarray/arraytypes.c.src
===================================================================
--- trunk/numpy/core/src/multiarray/arraytypes.c.src	2010-02-20 18:07:26 UTC (rev 8144)
+++ trunk/numpy/core/src/multiarray/arraytypes.c.src	2010-02-20 18:07:43 UTC (rev 8145)
@@ -334,7 +334,7 @@
     char *buffer;
 #endif
 
-    if (!PyString_Check(op) && !PyUnicode_Check(op) &&
+    if (!PyBytes_Check(op) && !PyUnicode_Check(op) &&
             PySequence_Check(op) && PySequence_Size(op) > 0) {
         PyErr_SetString(PyExc_ValueError,
                 "setting an array element with a sequence");
@@ -414,7 +414,7 @@
     while (*ptr-- == '\0' && size > 0) {
         size--;
     }
-    return PyString_FromStringAndSize(ip,size);
+    return PyBytes_FromStringAndSize(ip,size);
 }
 
 static int
@@ -424,7 +424,7 @@
     Py_ssize_t len;
     PyObject *temp = NULL;
 
-    if (!PyString_Check(op) && !PyUnicode_Check(op)
+    if (!PyBytes_Check(op) && !PyUnicode_Check(op)
             && PySequence_Check(op) && PySequence_Size(op) > 0) {
         PyErr_SetString(PyExc_ValueError,
                 "setting an array element with a sequence");



More information about the Numpy-svn mailing list