|
|
@ -42,7 +42,6 @@ import heapq
|
|
|
|
import inspect
|
|
|
|
import inspect
|
|
|
|
import logging
|
|
|
|
import logging
|
|
|
|
import os
|
|
|
|
import os
|
|
|
|
import platform
|
|
|
|
|
|
|
|
import re
|
|
|
|
import re
|
|
|
|
import signal
|
|
|
|
import signal
|
|
|
|
import socket
|
|
|
|
import socket
|
|
|
@ -1410,9 +1409,12 @@ class Connection(object):
|
|
|
|
# their respective values.
|
|
|
|
# their respective values.
|
|
|
|
# * CONTEXT_NAME must be prefixed with the name of the Python binary in
|
|
|
|
# * CONTEXT_NAME must be prefixed with the name of the Python binary in
|
|
|
|
# order to allow virtualenvs to detect their install prefix.
|
|
|
|
# order to allow virtualenvs to detect their install prefix.
|
|
|
|
# * For Darwin, OS X installs a craptacular argv0-introspecting Python
|
|
|
|
# * macOS <= 10.14 (Darwin <= 18) install an unreliable Python version
|
|
|
|
# version switcher as /usr/bin/python. Override attempts to call it
|
|
|
|
# switcher as /usr/bin/python, which introspects argv0. To workaround
|
|
|
|
# with an explicit call to python2.7
|
|
|
|
# it we redirect attempts to call /usr/bin/python with an explicit
|
|
|
|
|
|
|
|
# call to /usr/bin/python2.7. macOS 10.15+ (Darwin 19+) removed it.
|
|
|
|
|
|
|
|
# On these versions /usr/bin/python is a symlink to
|
|
|
|
|
|
|
|
# /System/Library/Frameworks/Python.framework/Versions/2.7/.../Python
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# Locals:
|
|
|
|
# Locals:
|
|
|
|
# R: read side of interpreter stdin.
|
|
|
|
# R: read side of interpreter stdin.
|
|
|
@ -1435,11 +1437,7 @@ class Connection(object):
|
|
|
|
os.close(r)
|
|
|
|
os.close(r)
|
|
|
|
os.close(W)
|
|
|
|
os.close(W)
|
|
|
|
os.close(w)
|
|
|
|
os.close(w)
|
|
|
|
# this doesn't apply anymore to Mac OSX 10.15+ (Darwin 19+), new interpreter looks like this:
|
|
|
|
if sys.executable+sys.platform=='/usr/bin/pythondarwin'and os.uname()[2]<'19':sys.executable+='2.7'
|
|
|
|
# /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
|
|
|
|
|
|
|
|
if sys.platform == 'darwin' and sys.executable == '/usr/bin/python' and \
|
|
|
|
|
|
|
|
int(platform.release()[:2]) < 19:
|
|
|
|
|
|
|
|
sys.executable += sys.version[:3]
|
|
|
|
|
|
|
|
os.environ['ARGV0']=sys.executable
|
|
|
|
os.environ['ARGV0']=sys.executable
|
|
|
|
os.execl(sys.executable,sys.executable+'(mitogen:CONTEXT_NAME)')
|
|
|
|
os.execl(sys.executable,sys.executable+'(mitogen:CONTEXT_NAME)')
|
|
|
|
os.write(1,'MITO000\n'.encode())
|
|
|
|
os.write(1,'MITO000\n'.encode())
|
|
|
|