diff options
author | m-d-w <mw9050@gmail.com> | 2013-06-10 18:07:30 -0400 |
---|---|---|
committer | m-d-w <mw9050@gmail.com> | 2013-06-10 18:07:30 -0400 |
commit | fda333b5b515adacd9d70ccdbac1e676386f4097 (patch) | |
tree | d7e303a4211a53caec2bf2fa0edd5dd667f057a8 | |
parent | 3118f4fe593039cc5d523590824b4f6b2b2de5f6 (diff) | |
download | numpy-fda333b5b515adacd9d70ccdbac1e676386f4097.tar.gz |
ENH: Optimize array creation by avoiding errors
-rw-r--r-- | numpy/core/src/multiarray/common.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/src/multiarray/common.c b/numpy/core/src/multiarray/common.c index 02d74050e..995d0db25 100644 --- a/numpy/core/src/multiarray/common.c +++ b/numpy/core/src/multiarray/common.c @@ -49,18 +49,18 @@ PyArray_GetAttrString_SuppressException(PyObject *obj, char *name) { PyTypeObject *tp = Py_TYPE(obj); PyObject *res = (PyObject *)NULL; - if (// Is not trivial type + if (/* Is not trivial type */ obj != Py_None && !PyList_CheckExact(obj) && !PyTuple_CheckExact(obj)) { - // Attribute referenced by (char *)name + /* Attribute referenced by (char *)name */ if (tp->tp_getattr != NULL) { res = (*tp->tp_getattr)(obj, name); if (res == NULL) { PyErr_Clear(); } } - // Attribute referenced by (PyObject *)name + /* Attribute referenced by (PyObject *)name */ else if (tp->tp_getattro != NULL) { #if defined(NPY_PY3K) PyObject *w = PyUnicode_InternFromString(name); |