slightly tidier

closes #496
This commit is contained in:
Casper da Costa-Luis 2018-04-29 22:39:12 +01:00
parent 26d0ff1fab
commit f66d9923d1
No known key found for this signature in database
GPG Key ID: 986B408043AE090D
1 changed files with 3 additions and 3 deletions

View File

@ -224,9 +224,9 @@ def _environ_cols_linux(fp): # pragma: no cover
try:
return array('h', ioctl(fp, TIOCGWINSZ, '\0' * 8))[1]
except:
if 'COLUMNS' in os.environ:
return int(os.environ['COLUMNS']) - 1
else:
try:
return int(os.environ["COLUMNS"]) - 1
except KeyError:
return None