diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2016-09-02 10:06:54 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-02 10:06:54 -0500 |
commit | 3dbbfd8db5c21c603620bebc98e03bc84334f11c (patch) | |
tree | e29eb26cfbf72ee9b03aa15dd02671bf17e70301 /numpy/core/numeric.py | |
parent | 9164f23c19c049e28d4d4825a53bbb01aedabcfc (diff) | |
parent | 68ea0c792db6bac435752e45d8681f7f1283453d (diff) | |
download | numpy-3dbbfd8db5c21c603620bebc98e03bc84334f11c.tar.gz |
Merge pull request #7148 from seberg/stacklevel+tests
ENH,TST: Bump stacklevel and add tests for warnings
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r-- | numpy/core/numeric.py | 10 |
1 files changed, 6 insertions, 4 deletions
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) |