summaryrefslogtreecommitdiff
path: root/numpy/lib/shape_base.py
diff options
context:
space:
mode:
authorStephan Hoyer <shoyer@gmail.com>2019-05-20 09:37:18 -0700
committerGitHub <noreply@github.com>2019-05-20 09:37:18 -0700
commitf9c1502e7ace9b48f0256a77c560aae43763a1f2 (patch)
tree1b04f2a79f979f6039a794173560da7153093ac9 /numpy/lib/shape_base.py
parentbdd75dff0aa8b77be5784923befb6410fc2f4837 (diff)
downloadnumpy-f9c1502e7ace9b48f0256a77c560aae43763a1f2.tar.gz
BUG: Increment stacklevel for warnings to account for NEP-18 overrides (#13589)
* Increment stacklevel for warnings to account for NEP-18 overrides For NumPy functions that make use of `__array_function__`, the appropriate the stack level for warnings should generally be increased by 1 to account for the override function defined in numpy.core.overrides. Fixes GH-13329 * Update numpy/lib/type_check.py Co-Authored-By: Sebastian Berg <sebastian@sipsolutions.net>
Diffstat (limited to 'numpy/lib/shape_base.py')
-rw-r--r--numpy/lib/shape_base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/shape_base.py b/numpy/lib/shape_base.py
index 8ebe7a695..1b66f3a3e 100644
--- a/numpy/lib/shape_base.py
+++ b/numpy/lib/shape_base.py
@@ -578,7 +578,7 @@ def expand_dims(a, axis):
# 2017-05-17, 1.13.0
warnings.warn("Both axis > a.ndim and axis < -a.ndim - 1 are "
"deprecated and will raise an AxisError in the future.",
- DeprecationWarning, stacklevel=2)
+ DeprecationWarning, stacklevel=3)
# When the deprecation period expires, delete this if block,
if axis < 0:
axis = axis + a.ndim + 1