File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -51,10 +51,12 @@ def is_dir(item: Any) -> bool: # noqa: ARG001
5151def _ (item : uproot .reading .ReadOnlyDirectory ) -> Literal [True ]: # noqa: ARG001
5252 return True
5353
54+
5455@is_dir .register
5556def _ (item : uproot .behaviors .TBranch .HasBranches ) -> bool :
5657 return len (item .branches ) > 0
5758
59+
5860@is_dir .register
5961def _ (item : uproot .behaviors .RNTuple .HasFields ) -> bool :
6062 return len (item .keys ()) > 0
@@ -155,8 +157,12 @@ def _process_item_tfile(
155157 )
156158
157159
158- @process_item .register
159- def _process_item_ttree (uproot_object : uproot .TTree | uproot .behaviors .RNTuple .RNTuple ) -> MetaDict :
160+ # Python 3.11 can just use `|` directly for register
161+ @process_item .register (uproot .TTree )
162+ @process_item .register (uproot .behaviors .RNTuple .RNTuple )
163+ def _process_item_ttree (
164+ uproot_object : uproot .TTree | uproot .behaviors .RNTuple .RNTuple ,
165+ ) -> MetaDict :
160166 """
161167 Given an tree, return a rich.tree.Tree output.
162168 """
You can’t perform that action at this time.
0 commit comments