diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2017-04-14 19:29:44 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-14 19:29:44 -0600 |
commit | 6c91e9ee0d9e9fc16e504780ccf7ede26d1114c8 (patch) | |
tree | 78075c826d7ef3230a7743034d80cb87997ab84e /numpy/lib/tests | |
parent | 0f3846aaabc7c1278e9aeab7aafa0b8d4a1b264e (diff) | |
parent | d1bb606012b069600ae60e37b7675122fdde29b8 (diff) | |
download | numpy-6c91e9ee0d9e9fc16e504780ccf7ede26d1114c8.tar.gz |
Merge pull request #6632 from mcmtroffaes/feature/fromfile-ioopen-bug
TST/BUG: fromfile - fix test and expose bug with io class argument
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r-- | numpy/lib/tests/test_io.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py index 2a494fe08..868089551 100644 --- a/numpy/lib/tests/test_io.py +++ b/numpy/lib/tests/test_io.py @@ -103,8 +103,9 @@ class RoundtripTest(object): if not isinstance(target_file, BytesIO): target_file.close() # holds an open file descriptor so it can't be deleted on win - if not isinstance(arr_reloaded, np.lib.npyio.NpzFile): - os.remove(target_file.name) + if 'arr_reloaded' in locals(): + if not isinstance(arr_reloaded, np.lib.npyio.NpzFile): + os.remove(target_file.name) def check_roundtrips(self, a): self.roundtrip(a) |