Skip to content

Commit

Permalink
Do not try to show attributes of an Attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
jmert committed Jan 15, 2021
1 parent 61c649c commit c9a087f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function _show_tree(io::IO, obj::Union{File,Group,Dataset,Datatype,Attributes,At
return nothing
end

if attributes
if attributes && !isa(obj, Attribute)
obj′ = obj isa Attributes ? obj.parent : obj
h5a_iterate(obj′, H5_INDEX_NAME, H5_ITER_INC) do _, cname, _, _
depth_check() && return herr_t(1)
Expand Down
4 changes: 4 additions & 0 deletions test/plain.jl
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,10 @@ HDF5.show_tree(iobuf, hfile["dtype"])
@test occursin(r"""
📄 HDF5.Datatype: /dtype""", String(take!(buf)))

HDF5.show_tree(iobuf, hfile["inner/data"]["mode"], attributes = true)
@test occursin(r"""
🏷️ HDF5.Attribute: mode""", String(take!(buf)))

# configurable options

# no emoji icons
Expand Down

0 comments on commit c9a087f

Please sign in to comment.