Skip to content

Commit 1d3d18d

Browse files
authored
h5py cleanup race fix (#3984)
* h5py cleanup race fix * revert bug
1 parent 5268209 commit 1d3d18d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

apis/python/src/tiledbsoma/io/_util.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ def read_h5ad(
5858
anndata = ad.read_h5ad(_FSPathWrapper(input_handle, input_path), mode)
5959
yield anndata
6060
finally:
61+
# This prevents a race condition with the REPL cleanup in ipython. See sc-65863
62+
if anndata.file:
63+
anndata.file.close()
6164
input_handle.close()
6265

6366

0 commit comments

Comments
 (0)