mirror of
https://github.com/beetbox/beets.git
synced 2026-01-29 11:35:27 +01:00
test_ui: Fix spurious warnings in completion test
probably an issue going back to the Python 2 -> 3 switch: `map` gives an iterator nowadays so after the test case started iterating BASH_COMPLETION_PATHS, print_completion() couldn't find the (previously found) bash_completion anymore, and would log a spurious warning about that. Also, some cleaup of path type handling
This commit is contained in:
parent
854fec2634
commit
26faf8daa9
1 changed files with 8 additions and 8 deletions
|
|
@ -1828,20 +1828,20 @@ default_commands.append(config_cmd)
|
|||
def print_completion(*args):
|
||||
for line in completion_script(default_commands + plugins.commands()):
|
||||
print_(line, end='')
|
||||
if not any(map(os.path.isfile, BASH_COMPLETION_PATHS)):
|
||||
if not any(os.path.isfile(syspath(p)) for p in BASH_COMPLETION_PATHS):
|
||||
log.warning('Warning: Unable to find the bash-completion package. '
|
||||
'Command line completion might not work.')
|
||||
|
||||
|
||||
BASH_COMPLETION_PATHS = map(syspath, [
|
||||
'/etc/bash_completion',
|
||||
'/usr/share/bash-completion/bash_completion',
|
||||
'/usr/local/share/bash-completion/bash_completion',
|
||||
BASH_COMPLETION_PATHS = [
|
||||
b'/etc/bash_completion',
|
||||
b'/usr/share/bash-completion/bash_completion',
|
||||
b'/usr/local/share/bash-completion/bash_completion',
|
||||
# SmartOS
|
||||
'/opt/local/share/bash-completion/bash_completion',
|
||||
b'/opt/local/share/bash-completion/bash_completion',
|
||||
# Homebrew (before bash-completion2)
|
||||
'/usr/local/etc/bash_completion',
|
||||
])
|
||||
b'/usr/local/etc/bash_completion',
|
||||
]
|
||||
|
||||
|
||||
def completion_script(commands):
|
||||
|
|
|
|||
Loading…
Reference in a new issue