summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/function_base.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/numpy/core/function_base.py b/numpy/core/function_base.py
index 6d49b9055..9e46f0ea5 100644
--- a/numpy/core/function_base.py
+++ b/numpy/core/function_base.py
@@ -110,13 +110,7 @@ def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None,
>>> plt.show()
"""
- try:
- num = operator.index(num)
- except TypeError:
- raise TypeError(
- "object of type {} cannot be safely interpreted as an integer."
- .format(type(num)))
-
+ num = operator.index(num)
if num < 0:
raise ValueError("Number of samples, %s, must be non-negative." % num)
div = (num - 1) if endpoint else num