[h5py] 13/26: More fixes for HDF5 1.8.5

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Jul 2 18:20:18 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to annotated tag 1.3.1
in repository h5py.

commit 90dab93774b5120ec5c2a4b50ffb4d2c66395f38
Author: andrewcollette <andrew.collette at gmail.com>
Date:   Sun Sep 26 15:29:44 2010 +0000

    More fixes for HDF5 1.8.5
---
 h5py/h5f.pyx                  |  2 +-
 h5py/h5p_laid.pxi             |  6 +++++-
 h5py/tests/high/test_links.py | 15 ++++++++++-----
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/h5py/h5f.pyx b/h5py/h5f.pyx
index 7078887..46c77ea 100644
--- a/h5py/h5f.pyx
+++ b/h5py/h5f.pyx
@@ -216,7 +216,7 @@ def get_obj_ids(object where=OBJ_ALL, int types=H5F_OBJ_ALL):
         for i from 0<=i<count:
             py_obj_list.append(wrap_identifier(obj_list[i]))
             # The HDF5 function returns a borrowed reference for each hid_t.
-            H5Iinc_ref(obj_list[i])
+            #H5Iinc_ref(obj_list[i])
         return py_obj_list
 
     finally:
diff --git a/h5py/h5p_laid.pxi b/h5py/h5p_laid.pxi
index e8e2b68..59a2ddd 100644
--- a/h5py/h5p_laid.pxi
+++ b/h5py/h5p_laid.pxi
@@ -85,5 +85,9 @@ cdef class PropLAID(PropInstanceID):
 
         Get the file access property list used when opening external files.
         """
-        return propwrap(H5Pget_elink_fapl(self.id))
+        cdef hid_t fid
+        fid = H5Pget_elink_fapl(self.id)
+        if H5Iget_ref(fid) > 1:
+            H5Idec_ref(fid)
+        return propwrap(fid)
 
diff --git a/h5py/tests/high/test_links.py b/h5py/tests/high/test_links.py
index 577d963..fdbf5f0 100644
--- a/h5py/tests/high/test_links.py
+++ b/h5py/tests/high/test_links.py
@@ -81,8 +81,11 @@ class TestExternal(Base):
         """ (Links) Access external link """
         self.f['ext'] = h5py.ExternalLink(self.ename, '/external')
         g = self.f['ext']
-        self.assert_(g)
-        self.assertIsInstance(g, h5py.Group)
+        try:
+            self.assert_(g)
+            self.assertIsInstance(g, h5py.Group)
+        finally:
+            g.file.close()
 
     @tests.require(api=18)
     def test_exc(self):
@@ -100,9 +103,11 @@ class TestExternal(Base):
     def test_file(self):
         """ (Links) File attribute works correctly on external links """
         self.f['ext'] = h5py.ExternalLink(self.ename, '/external')
-        g = self.f['ext']
-        self.assertNotEqual(g.file, self.f)
-
+        try:
+            g = self.f['ext']
+            self.assertNotEqual(g.file, self.f)
+        finally:
+            g.file.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