diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2016-01-23 15:58:58 +0100 |
---|---|---|
committer | Sebastian Berg <sebastian@sipsolutions.net> | 2016-09-02 16:39:17 +0200 |
commit | 7884a8c9f5f5c6657413dbeaa59ad969280d38ea (patch) | |
tree | 91b55f723315291bf2605bb42aef809a65ff1d85 /numpy/lib/npyio.py | |
parent | 9164f23c19c049e28d4d4825a53bbb01aedabcfc (diff) | |
download | numpy-7884a8c9f5f5c6657413dbeaa59ad969280d38ea.tar.gz |
ENH: Add stacklevel to all (or almost all) our function calls
Diffstat (limited to 'numpy/lib/npyio.py')
-rw-r--r-- | numpy/lib/npyio.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py index 534aa695c..0b2fdfaba 100644 --- a/numpy/lib/npyio.py +++ b/numpy/lib/npyio.py @@ -944,7 +944,7 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None, # End of lines reached first_line = '' first_vals = [] - warnings.warn('loadtxt: Empty input file: "%s"' % fname) + warnings.warn('loadtxt: Empty input file: "%s"' % fname, stacklevel=2) N = len(usecols or first_vals) dtype_types, packing = flatten_dtype(dtype) @@ -1542,7 +1542,7 @@ def genfromtxt(fname, dtype=float, comments='#', delimiter=None, # return an empty array if the datafile is empty first_line = asbytes('') first_values = [] - warnings.warn('genfromtxt: Empty input file: "%s"' % fname) + warnings.warn('genfromtxt: Empty input file: "%s"' % fname, stacklevel=2) # Should we take the first values as names ? if names is True: @@ -1827,7 +1827,7 @@ def genfromtxt(fname, dtype=float, comments='#', delimiter=None, raise ValueError(errmsg) # Issue a warning ? else: - warnings.warn(errmsg, ConversionWarning) + warnings.warn(errmsg, ConversionWarning, stacklevel=2) # Strip the last skip_footer data if skip_footer > 0: |