j
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import datetime
|
||||
import hashlib
|
||||
import inspect
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
@@ -996,16 +997,25 @@ class PipelineLiveProgress:
|
||||
def stop(self) -> None:
|
||||
# Safe to call whether Live is running or paused.
|
||||
if self._live is not None:
|
||||
stop_fn = self._live.stop
|
||||
has_clear = False
|
||||
try:
|
||||
try:
|
||||
self._live.stop(clear=True)
|
||||
except TypeError:
|
||||
self._live.stop()
|
||||
except Exception:
|
||||
self._live.stop()
|
||||
except Exception:
|
||||
signature = inspect.signature(stop_fn)
|
||||
has_clear = "clear" in signature.parameters
|
||||
except (ValueError, TypeError):
|
||||
pass
|
||||
|
||||
try:
|
||||
if has_clear:
|
||||
stop_fn(clear=True)
|
||||
else:
|
||||
stop_fn()
|
||||
except Exception:
|
||||
try:
|
||||
stop_fn()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
self._live = None
|
||||
self._console = None
|
||||
self._overall = None
|
||||
|
||||
Reference in New Issue
Block a user