call RangePop when exception raised in the enclosed block
@@ -182,7 +182,9 @@ def range(message, id_color=-1):
id_color (int): ID of color for a range.
"""
RangePush(message, id_color)
+ try:
yield
+ finally:
RangePop()
@@ -195,5 +197,7 @@ def rangeC(message, color=0):
color (uint32): Color for a range.
"""
RangePushC(message, color)
+ try:
yield
+ finally:
RangePop()
