From 963137c123c6d5e191e937a19c71d7216146150a Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 31 May 2021 22:06:25 +0200 Subject: [PATCH] Gracefully handle empty COLUMNS/LINES env vars on Linux. --- tqdm/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tqdm/utils.py b/tqdm/utils.py index aae87e45..64665990 100644 --- a/tqdm/utils.py +++ b/tqdm/utils.py @@ -285,7 +285,7 @@ def _screen_shape_linux(fp): # pragma: no cover except Exception: try: return [int(os.environ[i]) - 1 for i in ("COLUMNS", "LINES")] - except KeyError: + except (KeyError, ValueError): return None, None