mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
chore: improved fix for terminal error
This commit is contained in:
parent
ca3dee7b37
commit
1c5ca0f022
|
@ -59,7 +59,8 @@ class HyperoptOutput:
|
|||
|
||||
max_rows: Optional[int] = None
|
||||
|
||||
if self._streaming and "pytest" not in sys.modules:
|
||||
if self._streaming:
|
||||
try:
|
||||
ts = get_terminal_size()
|
||||
# Get terminal size.
|
||||
# Account for header, borders, and for the progress bar.
|
||||
|
@ -70,6 +71,9 @@ class HyperoptOutput:
|
|||
max_rows = -(int(ts.lines / 2) - 6)
|
||||
else:
|
||||
max_rows = -(ts.lines - 6)
|
||||
except OSError:
|
||||
# If we can't get the terminal size, we will just display the last 10 rows.
|
||||
pass
|
||||
|
||||
self.__init_table()
|
||||
for r in self._results[max_rows:]:
|
||||
|
|
Loading…
Reference in New Issue
Block a user