summaryrefslogtreecommitdiff
path: root/numpy/core/fromnumeric.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r--numpy/core/fromnumeric.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py
index 67d2c5b48..1bb9738fb 100644
--- a/numpy/core/fromnumeric.py
+++ b/numpy/core/fromnumeric.py
@@ -445,7 +445,13 @@ def put(a, ind, v, mode='raise'):
array([ 0, 1, 2, 3, -5])
"""
- return a.put(ind, v, mode)
+ try:
+ put = a.put
+ except AttributeError:
+ raise TypeError("argument 1 must be numpy.ndarray, "
+ "not {name}".format(name=type(a).__name__))
+
+ return put(ind, v, mode)
def swapaxes(a, axis1, axis2):