From 7884a8c9f5f5c6657413dbeaa59ad969280d38ea Mon Sep 17 00:00:00 2001 From: Sebastian Berg Date: Sat, 23 Jan 2016 15:58:58 +0100 Subject: ENH: Add stacklevel to all (or almost all) our function calls --- numpy/core/numeric.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'numpy/core/numeric.py') diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py index 8db4e1302..81ed0178a 100644 --- a/numpy/core/numeric.py +++ b/numpy/core/numeric.py @@ -1181,7 +1181,8 @@ def alterdot(): """ # 2014-08-13, 1.10 - warnings.warn("alterdot no longer does anything.", DeprecationWarning) + warnings.warn("alterdot no longer does anything.", + DeprecationWarning, stacklevel=2) def restoredot(): @@ -1205,7 +1206,8 @@ def restoredot(): """ # 2014-08-13, 1.10 - warnings.warn("restoredot no longer does anything.", DeprecationWarning) + warnings.warn("restoredot no longer does anything.", + DeprecationWarning, stacklevel=2) def tensordot(a, b, axes=2): @@ -2260,8 +2262,8 @@ def binary_repr(num, width=None): if width is not None and width < binwidth: warnings.warn( "Insufficient bit width provided. This behavior " - "will raise an error in the future.", DeprecationWarning - ) + "will raise an error in the future.", DeprecationWarning, + stacklevel=3) if num == 0: return '0' * (width or 1) -- cgit v1.2.1