From ae15cff503ab7cb15f24a5721381ed27cf5bd148 Mon Sep 17 00:00:00 2001 From: Nathan Page Date: Sat, 24 Oct 2020 16:23:24 -0400 Subject: [PATCH] provide comment as to why Live needs lock in process_renderables --- rich/live.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rich/live.py b/rich/live.py index 13589433..47daff29 100644 --- a/rich/live.py +++ b/rich/live.py @@ -156,7 +156,8 @@ class Live(JupyterMixin, RenderHook): ) -> List[ConsoleRenderable]: """Process renderables to restore cursor and display progress.""" if self.console.is_terminal: - with self._lock: # need to ensure data is not updating in between + # lock needs acquiring as user can modify live_render renerable at any time unlike in Progress. + with self._lock: renderables = [ self._live_render.position_cursor(), *renderables,