Gracefully handle empty COLUMNS/LINES env vars on Linux.

This commit is contained in:
Jannis Leidel 2021-05-31 22:06:25 +02:00 committed by Casper da Costa-Luis
parent 6180f188fb
commit 963137c123
1 changed files with 1 additions and 1 deletions

View File

@ -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