Skip to content

Commit 475c263

Browse files
Bordadeependujha
andauthored
Apply suggestions from code review
Co-authored-by: Deependu <[email protected]>
1 parent 879927a commit 475c263

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lightning/pytorch/callbacks/progress/rich_progress.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,9 @@ def _init_progress(self, trainer: "pl.Trainer") -> None:
338338
# because it now only pops one Live instance instead of clearing them all.
339339
# We check for `_live_stack` and clear it manually for compatibility across
340340
# both old and new Rich versions.
341-
if len(getattr(self._console, "_live_stack", [])) > 0:
341+
if hasattr(self._console, "_live_stack"):
342+
if len(self._console._live_stack) > 0:
343+
self._console.clear_live()
342344
self._console.clear_live()
343345
else:
344346
self._console.clear_live()

0 commit comments

Comments
 (0)