From 42e5b180cb4136275a116bccda74ea21cfe230da Mon Sep 17 00:00:00 2001 From: Guglie Date: Tue, 28 Nov 2017 19:49:08 +0100 Subject: [PATCH] Tools: fix sim_vehicle.py terminal tab when using --no-mavproxy --- Tools/autotest/sim_vehicle.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Tools/autotest/sim_vehicle.py b/Tools/autotest/sim_vehicle.py index 5f613abde6..5334bc7d0f 100755 --- a/Tools/autotest/sim_vehicle.py +++ b/Tools/autotest/sim_vehicle.py @@ -455,7 +455,20 @@ def run_in_terminal_window(autotest, name, cmd): out = subprocess.Popen(runme, stdout=subprocess.PIPE).communicate()[0] import re p = re.compile('tab 1 of window id (.*)') - windowID.append(p.findall(out)[0]) + + tstart = time.time() + while time.time() - tstart < 5: + tabs = p.findall(out) + + if len(tabs) > 0: + break + + time.sleep(0.1) + + if len(tabs) > 0: + windowID.append(tabs[0]) + else: + progress("Cannot find %s process terminal" % name ) else: p = subprocess.Popen(runme)