[lldb] Make Asan/SIP workaround work for Python 3

Make the check generic instead of hard-coding the path to Python 2. This
also fixes the print-syntax to be compatible with both versions.
This commit is contained in:
Jonas Devlieghere 2019-11-08 09:19:54 -08:00
parent 6b44a41fef
commit 4d0e07f786
1 changed files with 4 additions and 2 deletions

View File

@ -79,8 +79,10 @@ class LLDBTest(TestFormat):
if not os.path.isfile(copied_python):
import shutil, subprocess
python = subprocess.check_output([
'/usr/bin/python2.7', '-c',
'import sys; print sys.executable']).strip()
sys.executable,
'-c',
'import sys; print(sys.executable)'
]).decode('utf-8').strip()
shutil.copy(python, copied_python)
cmd[0] = copied_python