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 ros2 launch #147

Merged
merged 2 commits into from May 11, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions ros2launch/ros2launch/command/launch.py
Expand Up @@ -16,7 +16,11 @@

from ament_index_python.packages import get_package_prefix
from ament_index_python.packages import PackageNotFoundError
from argcomplete.completers import FilesCompleter
try:
from argcomplete.completers import FilesCompleter
except ImportError:
# argcomplete is not supported on Windows
Copy link
Member

Choose a reason for hiding this comment

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

nitpick: A better comment might indicate that argcomplete is optional

Suggested change
# argcomplete is not supported on Windows
# argcomplete is optional

pass
try:
from argcomplete.completers import SuppressCompleter
except ImportError:
Expand Down Expand Up @@ -54,7 +58,11 @@ def is_launch_file_or_dir(path):
return is_launch_file(path) or os.path.isdir(path)

# Complete paths to launch files
completions.extend(filter(is_launch_file_or_dir, FilesCompleter()(**pass_through_kwargs)))
try:
completions.extend(filter(is_launch_file_or_dir, FilesCompleter()(**pass_through_kwargs)))
except NameError:
# argcomplete is not supported on Windows
pass

return completions

Expand Down