diff --git a/docs/api.rst b/docs/api.rst index b4e2e40b..0bb42ec2 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -485,7 +485,7 @@ Router Class :param str python_path: Path to the Python interpreter to use for bootstrap. Defaults to - ``python2.7``. In future this may default to ``sys.executable``. + :data:`sys.executable`. For SSH, defaults to ``python``. :param bool debug: If :data:`True`, arrange for debug logging (:py:meth:`enable_debug`) to diff --git a/mitogen/parent.py b/mitogen/parent.py index d1175838..9bc069bc 100644 --- a/mitogen/parent.py +++ b/mitogen/parent.py @@ -672,7 +672,7 @@ class Stream(mitogen.core.Stream): Base for streams capable of starting new slaves. """ #: The path to the remote Python interpreter. - python_path = 'python' + python_path = sys.executable #: Maximum time to wait for a connection attempt. connect_timeout = 30.0 diff --git a/mitogen/ssh.py b/mitogen/ssh.py index 36efbffc..eae70a36 100644 --- a/mitogen/ssh.py +++ b/mitogen/ssh.py @@ -103,6 +103,10 @@ class Stream(mitogen.parent.Stream): create_child = staticmethod(mitogen.parent.hybrid_tty_create_child) child_is_immediate_subprocess = False + #: Default to whatever is available as 'python' on the remote machine, + #: overriding sys.executable use. + python_path = 'python' + #: Number of -v invocations to pass on command line. ssh_debug_level = 0