[lldb][tests] Platform triple can be None

If a remote target is not connected, SBPlatform's GetTriple function returns None.
This commit is contained in:
Tatyana Krasnukha 2019-12-10 18:00:50 +03:00
parent f57b35af2f
commit a58bd0e42c
1 changed files with 6 additions and 1 deletions

View File

@ -129,7 +129,12 @@ def getDarwinOSTriples():
def getPlatform():
"""Returns the target platform which the tests are running on."""
platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]
triple = lldb.DBG.GetSelectedPlatform().GetTriple()
if triple is None:
# It might be an unconnected remote platform.
return ''
platform = triple.split('-')[2]
if platform.startswith('freebsd'):
platform = 'freebsd'
elif platform.startswith('netbsd'):