code cleanup

This commit is contained in:
Steven Robertson 2019-10-29 17:51:27 -07:00
parent 50a11a80f0
commit cc11864b7d
2 changed files with 4 additions and 5 deletions

View File

@ -367,7 +367,6 @@ class PlayContextSpec(Spec):
# #511, #536: executor/module_common.py::_get_shebang() hard-wires
# "/usr/bin/python" as the default interpreter path if no other
# interpreter is specified.
# raise ValueError(parse_python_path(s))
return parse_python_path(s or '/usr/bin/python')
def private_key_file(self):
@ -582,7 +581,6 @@ class MitogenViaSpec(Spec):
# #511, #536: executor/module_common.py::_get_shebang() hard-wires
# "/usr/bin/python" as the default interpreter path if no other
# interpreter is specified.
# raise ValueError(parse_python_path(s))
return parse_python_path(s or '/usr/bin/python')
def private_key_file(self):

View File

@ -1457,11 +1457,12 @@ class Connection(object):
def get_python_argv(self):
"""
Return the command necessary to invoke Python,
by returning a 1-element list containing :attr:`python_path` + codecs
Return the initial argument vector elements necessary to invoke Python,
by returning a 1-element list containing :attr:`python_path` if it is a
string, or simply returning it if it is already a list.
This allows emulation of existing tools where the Python invocation may
be set to e.g. `['/usr/bin/env', 'python']`
be set to e.g. `['/usr/bin/env', 'python']`.
"""
if isinstance(self.options.python_path, list):
return self.options.python_path