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/lib/format.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'numpy/lib/format.py') diff --git a/numpy/lib/format.py b/numpy/lib/format.py index e62677bd8..633aee675 100644 --- a/numpy/lib/format.py +++ b/numpy/lib/format.py @@ -556,7 +556,7 @@ def write_array(fp, array, version=None, allow_pickle=True, pickle_kwargs=None): # this warning can be removed when 1.9 has aged enough if version != (2, 0) and used_ver == (2, 0): warnings.warn("Stored array in format 2.0. It can only be" - "read by NumPy >= 1.9", UserWarning) + "read by NumPy >= 1.9", UserWarning, stacklevel=2) if array.itemsize == 0: buffersize = 0 @@ -759,7 +759,7 @@ def open_memmap(filename, mode='r+', dtype=None, shape=None, # this warning can be removed when 1.9 has aged enough if version != (2, 0) and used_ver == (2, 0): warnings.warn("Stored array in format 2.0. It can only be" - "read by NumPy >= 1.9", UserWarning) + "read by NumPy >= 1.9", UserWarning, stacklevel=2) offset = fp.tell() finally: fp.close() -- cgit v1.2.1