[Numpy-svn] r3387 - trunk/numpy/core/src

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Oct 23 18:17:24 CDT 2006


Author: oliphant
Date: 2006-10-23 18:17:22 -0500 (Mon, 23 Oct 2006)
New Revision: 3387

Modified:
   trunk/numpy/core/src/ufuncobject.c
Log:
Initialize pos before calling PyDict_Next.

Modified: trunk/numpy/core/src/ufuncobject.c
===================================================================
--- trunk/numpy/core/src/ufuncobject.c	2006-10-23 23:08:00 UTC (rev 3386)
+++ trunk/numpy/core/src/ufuncobject.c	2006-10-23 23:17:22 UTC (rev 3387)
@@ -1613,21 +1613,23 @@
         */
         if (kwds != NULL) {
                 PyObject *key, *value;
-                Py_ssize_t pos;
+                Py_ssize_t pos=0;
                 while (PyDict_Next(kwds, &pos, &key, &value)) {
                         if (!PyString_Check(key)) {
-                                PyErr_SetString(PyExc_TypeError, "invalid keyword");
+                                PyErr_SetString(PyExc_TypeError, 
+                                                "invalid keyword");
                                 goto fail;
                         }
-                        if (strncmp(PyString_AS_STRING(key), "extobj", 6) == 0) {
+                        if (strncmp(PyString_AS_STRING(key),"extobj",6) == 0) {
                                 extobj = value;
                         }
-                        else if (strncmp(PyString_AS_STRING(key), "sig", 5) == 0) {
+                        else if (strncmp(PyString_AS_STRING(key),"sig",5)==0) {
                                 typetup = value;
                         }
                         else {
                                 PyErr_Format(PyExc_TypeError, 
-                                             "'%s' is an invalid keyword to %s",
+                                             "'%s' is an invalid keyword " \
+                                             "to %s",
                                              PyString_AS_STRING(key), name);
                                 goto fail;
                         }



More information about the Numpy-svn mailing list