[issue26801] Fix shutil.get_terminal_size() to catch AttributeError

Martin Panter report at bugs.python.org
Sun Apr 24 00:40:42 EDT 2016


Martin Panter added the comment:

Serhiy’s patch looks worthwhile to me, though I still think a comment would help. There are lots of different cases being handled by those few lines:

try:
   size = os.get_terminal_size(sys.__stdout__.fileno())
except (AttributeError, ValueError, OSError)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26801>
_______________________________________


More information about the Python-bugs-list mailing list