Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix flake8 errors (Unnecessary list comprehension) #928

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/rosdep2/platforms/osx.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def handle_options(options):

# make sure options is a list of list of strings
try:
valid = all([isinstance(x, _basestring) for option in options for x in option])
valid = all(isinstance(x, _basestring) for option in options for x in option)
except Exception as e:
raise InvalidData("Invalid list of options '%s', error: %s" % (options, e))
else:
Expand Down
2 changes: 1 addition & 1 deletion src/rosdep2/sources_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ def get_view_dependencies(self, view_name):
if view_name != SourcesListLoader.ALL_VIEW_KEY:
# if the view_name matches one of our sources, return
# empty list as none of our sources has deps.
if any([x for x in self.sources if view_name == x.url]):
if any(x for x in self.sources if view_name == x.url):
return []

# not one of our views, so it depends on everything we provide
Expand Down
4 changes: 2 additions & 2 deletions test/test_rosdep_sources_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def test_SourcesListLoader_create_default():
loader = SourcesListLoader.create_default(matcher, sources_cache_dir=tempdir)
assert loader.sources
sources0 = loader.sources
assert not any([s for s in loader.sources if not matcher.matches(s)])
assert not any(s for s in loader.sources if not matcher.matches(s))

loader = SourcesListLoader.create_default(matcher, sources_cache_dir=tempdir)
assert sources0 == loader.sources
Expand All @@ -445,7 +445,7 @@ def test_SourcesListLoader_create_default():
assert loader2.sources
# - should have filtered down to python-only
assert sources0 != loader2.sources
assert not any([s for s in loader2.sources if not matcher2.matches(s)])
assert not any(s for s in loader2.sources if not matcher2.matches(s))

# test API

Expand Down
Loading