pip module: fix TypeError (#31395)

* pip: add test: an error occurs when pip not found
* pip: fix TypeError exception when pip executable isn't found
This commit is contained in:
Pilou 2017-10-09 19:01:21 +02:00 committed by Matt Clay
commit 1c9bffe248
6 changed files with 31 additions and 5 deletions

View file

@ -286,7 +286,7 @@ def _get_pip(module, env=None, executable=None):
else:
# For-else: Means that we did not break out of the loop
# (therefore, that pip was not found)
module.fail_json(msg='Unable to find any of %s to use. pip' +
module.fail_json(msg='Unable to find any of %s to use. pip'
' needs to be installed.' % ', '.join(candidate_pip_basenames))
else:
# If we're using a virtualenv we must use the pip from the