@ -23,11 +23,11 @@ def main():
# revert the Mitogen OSX tweak since discover_interpreter() doesn't return this info
# revert the Mitogen OSX tweak since discover_interpreter() doesn't return this info
# NB This must be synced with mitogen.parent.Connection.get_boot_command()
# NB This must be synced with mitogen.parent.Connection.get_boot_command()
platform_release_major = int ( platform . release ( ) . partition ( ' . ' ) [ 0 ] )
if sys . modules . get ( ' mitogen ' ) and sys . platform == ' darwin ' :
if sys . modules . get ( ' mitogen ' ) and sys . platform == ' darwin ' :
darwin_major = int ( platform . release ( ) . partition ( ' . ' ) [ 0 ] )
if platform_release_major < 19 and sys . executable == ' /usr/bin/python2.7 ' :
if darwin_major < 19 and sys . executable == ' /usr/bin/python2.7 ' :
sys . executable = ' /usr/bin/python '
sys . executable = ' /usr/bin/python '
if darwin _major in ( 20 , 21 ) and sys . version_info [ : 2 ] == ( 2 , 7 ) :
if platform_release _major in ( 20 , 21 ) and sys . version_info [ : 2 ] == ( 2 , 7 ) :
# only for tests to check version of running interpreter -- Mac 10.15+ changed python2
# only for tests to check version of running interpreter -- Mac 10.15+ changed python2
# so it looks like it's /usr/bin/python but actually it's /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
# so it looks like it's /usr/bin/python but actually it's /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
sys . executable = " /usr/bin/python "
sys . executable = " /usr/bin/python "
@ -46,12 +46,21 @@ def main():
' resolved ' : os . path . realpath ( discovered_interpreter_python ) ,
' resolved ' : os . path . realpath ( discovered_interpreter_python ) ,
} ,
} ,
' running_python ' : {
' running_python ' : {
' platform ' : {
' release ' : {
' major ' : platform_release_major ,
} ,
} ,
' sys ' : {
' sys ' : {
' executable ' : {
' executable ' : {
' as_seen ' : sys . executable ,
' as_seen ' : sys . executable ,
' resolved ' : os . path . realpath ( sys . executable ) ,
' resolved ' : os . path . realpath ( sys . executable ) ,
} ,
} ,
' platform ' : sys . platform ,
' platform ' : sys . platform ,
' version_info ' : {
' major ' : sys . version_info [ 0 ] ,
' minor ' : sys . version_info [ 1 ] ,
} ,
} ,
} ,
} ,
} ,
}
}