Skip to content

Commit 68e6ce5

Browse files
committed
build_heading_block: term size detect fallback
1 parent 1e36145 commit 68e6ce5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

django_utils_lib/logging_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from os import get_terminal_size
1+
from shutil import get_terminal_size
22
from typing import Any, Dict, List, Literal, TypedDict, Union
33

44

@@ -11,7 +11,7 @@ def build_heading_block(heading: Union[str, List[str]], border_width=2) -> str:
1111
===============
1212
```
1313
"""
14-
terminal_width = get_terminal_size().columns
14+
terminal_width = get_terminal_size(fallback=(80, 24)).columns
1515
heading_delim = "".ljust(terminal_width, "=")
1616
heading_lines = [heading_delim]
1717

0 commit comments

Comments
 (0)