Skip to content
Browse files

BUG: Make shape check for special case a bit stricter

  • Loading branch information...
1 parent fa967ee commit 9e7a7665394f8f314428343a6c7a9dfdcadf40ed @87 committed Sep 16, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 numpy/core/src/multiarray/ctors.c
View
4 numpy/core/src/multiarray/ctors.c
@@ -2065,8 +2065,8 @@ PyArray_FromInterface(PyObject *origin)
/* Get data buffer from interface specification */
attr = PyDict_GetItemString(iface, "data");
- /* Special case for scalars that do not specify shape or data */
- if ((attr == NULL) && ((n == 0) || (dims[0] <= 1))) {
+ /* Special case for scalars that do not specify data */
+ if ((attr == NULL) && ((n == 0) || ((n == 1) && (dims[0] <= 1)))) {
/* Pointers to data and base should already be NULL! */
n = dims[0] = 1;
}

0 comments on commit 9e7a766

Please sign in to comment.
Something went wrong with that request. Please try again.