diff options
author | Yaroslav Halchenko <debian@onerussian.com> | 2016-01-27 22:12:51 -0500 |
---|---|---|
committer | Yaroslav Halchenko <debian@onerussian.com> | 2016-01-27 22:12:51 -0500 |
commit | 8a22dd42c2644c05500e2cea6974a6988a9dd01d (patch) | |
tree | 03d9e616f3de5afe9d2f29644b4bfe4c75732acf /numpy/lib/npyio.py | |
parent | 33777c64fefbd0919d3cf8f832c302205b4ede23 (diff) | |
download | numpy-8a22dd42c2644c05500e2cea6974a6988a9dd01d.tar.gz |
ENH: catch and rethrow exception in _savez upon IOError with filename info
Diffstat (limited to 'numpy/lib/npyio.py')
-rw-r--r-- | numpy/lib/npyio.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py index dd15db4b8..a80053750 100644 --- a/numpy/lib/npyio.py +++ b/numpy/lib/npyio.py @@ -644,6 +644,8 @@ def _savez(file, args, kwds, compress, allow_pickle=True, pickle_kwargs=None): fid.close() fid = None zipf.write(tmpfile, arcname=fname) + except IOError as exc: + raise IOError("Failed to write to %s: %s" % (tmpfile, exc)) finally: if fid: fid.close() |