summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/core/oldnumeric.py5
-rw-r--r--numpy/core/src/arraymethods.c9
2 files changed, 6 insertions, 8 deletions
diff --git a/numpy/core/oldnumeric.py b/numpy/core/oldnumeric.py
index 3bc1b13de..50e2b4c29 100644
--- a/numpy/core/oldnumeric.py
+++ b/numpy/core/oldnumeric.py
@@ -358,10 +358,7 @@ def ravel(m,order='C'):
a copy.
"""
a = asarray(m)
- try:
- return a.ravel(order)
- except ValueError:
- return a.copy(order).ravel(None)
+ return a.ravel(order)
def nonzero(a):
"""nonzero(a) returns the indices of the elements of a which are not zero,
diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c
index a118787c7..7ec1e9bc1 100644
--- a/numpy/core/src/arraymethods.c
+++ b/numpy/core/src/arraymethods.c
@@ -68,10 +68,11 @@ array_putmask(PyArrayObject *self, PyObject *args, PyObject *kwds)
}
static char doc_reshape[] = \
- "self.reshape(d1, d2, ..., dn, order='C') \n" \
- "Return a new array from this one. \n" \
- "\n The new array must have the same number of elements as self. " \
- "Also\n a copy of the data only occurs if necessary.";
+ "self.reshape(d1, d2, ..., dn, order='C') \n"
+ "Return a new array from this one. \n"
+ "\n The new array must have the same number of elements as self. "
+ "Also\n always returns a view or raises a ValueError if that is \n"
+ "impossible.";
static PyObject *
array_reshape(PyArrayObject *self, PyObject *args, PyObject *kwds)