summaryrefslogtreecommitdiff
path: root/numpy/lib/function_base.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/function_base.py')
-rw-r--r--numpy/lib/function_base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 0ede094f7..5bcd3a443 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -1286,7 +1286,7 @@ def insert(arr, obj, values, axis=None):
newshape = list(arr.shape)
if isinstance(obj, (int, long, integer)):
if (obj < 0): obj += N
- if (obj < 0 or obj >=N):
+ if (obj < 0 or obj > N or (obj == N and N != 0)):
raise ValueError, "index (%d) out of range (0<=index<=%d) "\
"in dimension %d" % (obj, N, axis)
newshape[axis] += 1;