tests/multi_bluetooth: Change dict index-and-del to pop, to clear event.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
This commit is contained in:
parent
61d1e4b01b
commit
7e75245d54
@ -77,9 +77,7 @@ def wait_for_event(event, timeout_ms):
|
||||
t0 = time.ticks_ms()
|
||||
while time.ticks_diff(time.ticks_ms(), t0) < timeout_ms:
|
||||
if event in waiting_events:
|
||||
result = waiting_events[event]
|
||||
del waiting_events[event]
|
||||
return result
|
||||
return waiting_events.pop(event)
|
||||
machine.idle()
|
||||
raise ValueError("Timeout waiting for {}".format(event))
|
||||
|
||||
|
@ -33,9 +33,7 @@ def wait_for_event(event, timeout_ms):
|
||||
t0 = time.ticks_ms()
|
||||
while time.ticks_diff(time.ticks_ms(), t0) < timeout_ms:
|
||||
if event in waiting_events:
|
||||
result = waiting_events[event]
|
||||
del waiting_events[event]
|
||||
return result
|
||||
return waiting_events.pop(event)
|
||||
machine.idle()
|
||||
raise ValueError("Timeout waiting for {}".format(event))
|
||||
|
||||
|
@ -49,9 +49,7 @@ def wait_for_event(event, timeout_ms):
|
||||
t0 = time.ticks_ms()
|
||||
while time.ticks_diff(time.ticks_ms(), t0) < timeout_ms:
|
||||
if event in waiting_events:
|
||||
result = waiting_events[event]
|
||||
del waiting_events[event]
|
||||
return result
|
||||
return waiting_events.pop(event)
|
||||
machine.idle()
|
||||
raise ValueError("Timeout waiting for {}".format(event))
|
||||
|
||||
|
@ -76,9 +76,7 @@ def wait_for_event(event, timeout_ms):
|
||||
t0 = time.ticks_ms()
|
||||
while time.ticks_diff(time.ticks_ms(), t0) < timeout_ms:
|
||||
if event in waiting_events:
|
||||
result = waiting_events[event]
|
||||
del waiting_events[event]
|
||||
return result
|
||||
return waiting_events.pop(event)
|
||||
machine.idle()
|
||||
raise ValueError("Timeout waiting for {}".format(event))
|
||||
|
||||
|
@ -55,9 +55,7 @@ def wait_for_event(event, timeout_ms):
|
||||
t0 = time.ticks_ms()
|
||||
while time.ticks_diff(time.ticks_ms(), t0) < timeout_ms:
|
||||
if event in waiting_events:
|
||||
result = waiting_events[event]
|
||||
del waiting_events[event]
|
||||
return result
|
||||
return waiting_events.pop(event)
|
||||
machine.idle()
|
||||
raise ValueError("Timeout waiting for {}".format(event))
|
||||
|
||||
|
@ -87,9 +87,7 @@ def wait_for_event(event, timeout_ms):
|
||||
t0 = time.ticks_ms()
|
||||
while time.ticks_diff(time.ticks_ms(), t0) < timeout_ms:
|
||||
if event in waiting_events:
|
||||
result = waiting_events[event]
|
||||
del waiting_events[event]
|
||||
return result
|
||||
return waiting_events.pop(event)
|
||||
machine.idle()
|
||||
raise ValueError("Timeout waiting for {}".format(event))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user