diff --git a/ansible_mitogen/transport_config.py b/ansible_mitogen/transport_config.py index 92de32ec..21c16a99 100644 --- a/ansible_mitogen/transport_config.py +++ b/ansible_mitogen/transport_config.py @@ -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): diff --git a/mitogen/parent.py b/mitogen/parent.py index 6ca6369a..ce75ef64 100644 --- a/mitogen/parent.py +++ b/mitogen/parent.py @@ -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