summaryrefslogtreecommitdiff
path: root/numpy/core
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core')
-rw-r--r--numpy/core/function_base.py2
-rw-r--r--numpy/core/tests/test_function_base.py4
2 files changed, 2 insertions, 4 deletions
diff --git a/numpy/core/function_base.py b/numpy/core/function_base.py
index cb5d253e5..750fbe838 100644
--- a/numpy/core/function_base.py
+++ b/numpy/core/function_base.py
@@ -14,9 +14,9 @@ def _index_deprecate(i, stacklevel=2):
except TypeError:
msg = ("object of type {} cannot be safely interpreted as "
"an integer.".format(type(i)))
+ i = int(i)
stacklevel += 1
warnings.warn(msg, DeprecationWarning, stacklevel=stacklevel)
- i = int(i)
return i
diff --git a/numpy/core/tests/test_function_base.py b/numpy/core/tests/test_function_base.py
index 162e7bd23..6b5430611 100644
--- a/numpy/core/tests/test_function_base.py
+++ b/numpy/core/tests/test_function_base.py
@@ -1,12 +1,10 @@
from __future__ import division, absolute_import, print_function
-import warnings
-
from numpy import (logspace, linspace, dtype, array, finfo, typecodes, arange,
isnan, ndarray)
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_equal, assert_raises,
- assert_array_equal, assert_warns
+ assert_array_equal
)