You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Resolver.glob on node without children gives IndexError.
For non-existing paths it also seems to return nothing instead of an empty iterable, which would be preferred.
When using resolver.get instead it gives correct output instead.
importanytreenode=anytree.Node("root")
resolver=anytree.Resolver()
resolver.glob(node, "/root") # IndexError, expected [node]resolver.glob(node, ".") # IndexError, expected [node]resolver.glob(node, "") # IndexError, expected [node]resolver.glob(node, "..") # IndexError, expected (ResolverError or just [], but should be consistent with get)resolver.glob(node, "root") # Returns nothing, expected []resolver.glob(node, "bla") # Returns nothing, expected []resolver.glob(node, "/bla") # Returns nothing, expected []
Version used is 2.8.0
The text was updated successfully, but these errors were encountered:
I agree, that the Resolver is a little bit too addicted to exceptions.
I will add a relax attribute, which gives expected empty list.
I will also ensure consistency between get and glob.
Resolver.glob on node without children gives IndexError.
For non-existing paths it also seems to return nothing instead of an empty iterable, which would be preferred.
When using resolver.get instead it gives correct output instead.
Version used is 2.8.0
The text was updated successfully, but these errors were encountered: