[h5py] 400/455: Fix File close() with mutiple copies
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:19:55 UTC 2015
This is an automated email from the git hooks/post-receive script.
ghisvail-guest pushed a commit to annotated tag 1.3.0
in repository h5py.
commit 81cd4f6c2ecc70059405819964994c8d4d735929
Author: andrewcollette <andrew.collette at gmail.com>
Date: Tue Feb 9 05:51:29 2010 +0000
Fix File close() with mutiple copies
---
h5py/highlevel.py | 3 ++-
h5py/tests/high/test_file.py | 9 +++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/h5py/highlevel.py b/h5py/highlevel.py
index a7c369d..2c9de78 100644
--- a/h5py/highlevel.py
+++ b/h5py/highlevel.py
@@ -806,7 +806,8 @@ class File(Group):
""" Close this HDF5 file. All open objects will be invalidated.
"""
with phil:
- self.fid.close()
+ while self.fid:
+ self.fid.close()
def flush(self):
""" Tell the HDF5 library to flush its buffers.
diff --git a/h5py/tests/high/test_file.py b/h5py/tests/high/test_file.py
index 64a39dd..cffb317 100644
--- a/h5py/tests/high/test_file.py
+++ b/h5py/tests/high/test_file.py
@@ -164,6 +164,15 @@ class TestOps(tests.HTest):
self.f.close()
self.assert_(not self.f)
+ def test_close_multi(self):
+ """ (File) File close() affects all copies of identifier """
+ g = self.f.create_group('a')
+ f2 = g.file
+ self.assert_(f2 is not self.f)
+ self.f.close()
+ self.assert_(not self.f)
+ self.assert_(not f2)
+
def test_exc(self):
""" (File) I/O on closed file results in ValueError """
self.f.close()
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/h5py.git
More information about the debian-science-commits
mailing list