diff options
author | Emilien Kofman <emilien.kofman@gmail.com> | 2016-03-09 09:29:18 +0100 |
---|---|---|
committer | Emilien Kofman <emilien.kofman@gmail.com> | 2016-03-09 09:29:18 +0100 |
commit | 3af411b270c8ec57ca9ced6fb69029cd86a8e417 (patch) | |
tree | cf0f0ef09ba9dc42ee4a1231c8aab1c2c20093d5 /numpy/core | |
parent | 04df564cc6a107ceb9b8d54faf516dc408f96cbb (diff) | |
download | numpy-3af411b270c8ec57ca9ced6fb69029cd86a8e417.tar.gz |
DEP: Deprecated using a float index in linspace
Diffstat (limited to 'numpy/core')
-rw-r--r-- | numpy/core/function_base.py | 2 | ||||
-rw-r--r-- | numpy/core/tests/test_function_base.py | 4 |
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 ) |