diff options
author | Ralf Gommers <ralf.gommers@googlemail.com> | 2011-08-10 22:59:09 +0200 |
---|---|---|
committer | Ralf Gommers <ralf.gommers@googlemail.com> | 2011-08-10 22:59:09 +0200 |
commit | 57b56bc6409f30039e59d5476feb675d2c279564 (patch) | |
tree | 033016b3cb8de6fc15043de82f3cac66e601d1b2 /numpy/lib/npyio.py | |
parent | 26aa3cfa5bfa5f235bfbe5943c211a43af3d42f5 (diff) | |
download | numpy-57b56bc6409f30039e59d5476feb675d2c279564.tar.gz |
BUG: fix failing npyio test under py3k. Thanks to Derek Homeier. Closes #1793.
Diffstat (limited to 'numpy/lib/npyio.py')
-rw-r--r-- | numpy/lib/npyio.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py index 44a91c0c7..6c4a9942f 100644 --- a/numpy/lib/npyio.py +++ b/numpy/lib/npyio.py @@ -763,6 +763,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) N = len(usecols or first_vals) dtype_types, packing = flatten_dtype(dtype) @@ -1275,7 +1276,7 @@ def genfromtxt(fname, dtype=float, comments='#', delimiter=None, first_values = split_line(first_line) except StopIteration: # return an empty array if the datafile is empty - first_line = '' + first_line = asbytes('') first_values = [] warnings.warn('genfromtxt: Empty input file: "%s"' % fname) |