Skip to content

Commit

Permalink
Fixed filter_globs for noetic (#506)
Browse files Browse the repository at this point in the history
Service calls with non empty requests (e.g. /rosapi/topics_for_type) were crashing due to filter's return type in python 3.
  • Loading branch information
foreignrobot committed May 30, 2020
1 parent 8d94b0b commit ad61c2a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions rosapi/src/rosapi/glob_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ def get_param(param_name):
def filter_globs(globs, full_list):
# If the globs are empty (weren't defined in the params), return the full list
if globs is not None and len(globs) > 0:
return filter(lambda x: any_match(x, globs), full_list)
return [i for i in filter(lambda x: any_match(x, globs), full_list)]
else:
return full_list


def any_match(query, globs):
return globs is None or len(globs) == 0 or any(fnmatch.fnmatch(str(query), glob) for glob in globs)

1 comment on commit ad61c2a

@reinzor
Copy link

@reinzor reinzor commented on ad61c2a Aug 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get a Noetic release that includes this fix? Then we can step back to the deb packages :). @mvollrath

Please sign in to comment.