Skip to content

Commit

Permalink
Fix ansible-test target completion on Python 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattclay committed Aug 15, 2017
1 parent ebbb536 commit 0ff5815
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/runner/lib/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import errno
import itertools
import abc
import sys

from lib.util import ApplicationError

Expand All @@ -21,7 +22,8 @@ def find_target_completion(target_func, prefix):
"""
try:
targets = target_func()
prefix = prefix.encode()
if sys.version_info[0] == 2:
prefix = prefix.encode()
short = os.environ.get('COMP_TYPE') == '63' # double tab completion from bash
matches = walk_completion_targets(targets, prefix, short)
return matches
Expand Down

0 comments on commit 0ff5815

Please sign in to comment.