mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix ansible-test target completion on Python 3.
This commit is contained in:
parent
ebbb5369b5
commit
0ff5815a4f
1 changed files with 3 additions and 1 deletions
|
@ -7,6 +7,7 @@ import re
|
||||||
import errno
|
import errno
|
||||||
import itertools
|
import itertools
|
||||||
import abc
|
import abc
|
||||||
|
import sys
|
||||||
|
|
||||||
from lib.util import ApplicationError
|
from lib.util import ApplicationError
|
||||||
|
|
||||||
|
@ -21,6 +22,7 @@ def find_target_completion(target_func, prefix):
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
targets = target_func()
|
targets = target_func()
|
||||||
|
if sys.version_info[0] == 2:
|
||||||
prefix = prefix.encode()
|
prefix = prefix.encode()
|
||||||
short = os.environ.get('COMP_TYPE') == '63' # double tab completion from bash
|
short = os.environ.get('COMP_TYPE') == '63' # double tab completion from bash
|
||||||
matches = walk_completion_targets(targets, prefix, short)
|
matches = walk_completion_targets(targets, prefix, short)
|
||||||
|
|
Loading…
Reference in a new issue