diff --git a/mitogen/parent.py b/mitogen/parent.py index 899f8955..aeebc43a 100644 --- a/mitogen/parent.py +++ b/mitogen/parent.py @@ -686,11 +686,6 @@ class Stream(mitogen.core.Stream): self.max_message_size = max_message_size if python_path: self.python_path = python_path - if sys.platform == 'darwin' and self.python_path == '/usr/bin/python': - # OS X installs a craptacular argv0-introspecting Python version - # switcher as /usr/bin/python. Override attempts to call it with an - # explicit call to python2.7 - self.python_path = '/usr/bin/python2.7' if connect_timeout: self.connect_timeout = connect_timeout if remote_name is None: @@ -775,6 +770,9 @@ class Stream(mitogen.core.Stream): # substituted with their respective values. # * CONTEXT_NAME must be prefixed with the name of the Python binary in # order to allow virtualenvs to detect their install prefix. + # * For Darwin, OS X installs a craptacular argv0-introspecting Python + # version switcher as /usr/bin/python. Override attempts to call it + # with an explicit call to python2.7 @staticmethod def _first_stage(): R,W=os.pipe() @@ -787,6 +785,8 @@ class Stream(mitogen.core.Stream): os.close(r) os.close(W) os.close(w) + if sys.platform == 'darwin' and sys.executable == '/usr/bin/python': + sys.executable += sys.version[:3] os.environ['ARGV0']=sys.executable os.execl(sys.executable,sys.executable+'(mitogen:CONTEXT_NAME)') os.write(1,'EC0\n') diff --git a/mitogen/ssh.py b/mitogen/ssh.py index 5e81ff46..5c0df8dc 100644 --- a/mitogen/ssh.py +++ b/mitogen/ssh.py @@ -91,7 +91,6 @@ class HostKeyError(mitogen.core.StreamError): class Stream(mitogen.parent.Stream): create_child = staticmethod(mitogen.parent.hybrid_tty_create_child) child_is_immediate_subprocess = False - python_path = 'python2.7' #: Number of -v invocations to pass on command line. ssh_debug_level = 0