diff --git a/mypy/util.py b/mypy/util.py index 8f9448bcff4c..84859fa94e70 100644 --- a/mypy/util.py +++ b/mypy/util.py @@ -424,9 +424,12 @@ def get_terminal_width() -> int: """Get current terminal width if possible, otherwise return the default one.""" try: cols, _ = os.get_terminal_size() - return cols except OSError: return DEFAULT_COLUMNS + else: + if cols == 0: + return DEFAULT_COLUMNS + return cols def soft_wrap(msg: str, max_len: int, first_offset: int, pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy