Commit 06b26b63 by Nick de Veaux

os.getenv does not raise an exception when the value is not found. This code fix…

os.getenv does not raise an exception when the value is not found. This code fix returns (LINES, COLUMNS) when the env vars are defined, (25, 80) when they are not defined. Previously, (None, None) was returned
parent 535c6c1c
......@@ -74,9 +74,6 @@ def get_terminal_size_unix():
except:
pass
if not cr:
try:
cr = (os.getenv('LINES'), os.getenv('COLUMNS'))
except:
cr = (25, 80)
cr = (os.getenv('LINES', 25), os.getenv('COLUMNS', 80))
return int(cr[1]), int(cr[0])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment