mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Merge 3.5: issue #26801
This commit is contained in:
commit
5bfe0da808
4 changed files with 8 additions and 1 deletions
|
@ -1072,7 +1072,7 @@ def get_terminal_size(fallback=(80, 24)):
|
|||
if columns <= 0 or lines <= 0:
|
||||
try:
|
||||
size = os.get_terminal_size(sys.__stdout__.fileno())
|
||||
except (NameError, OSError):
|
||||
except (AttributeError, OSError):
|
||||
size = os.terminal_size(fallback)
|
||||
if columns <= 0:
|
||||
columns = size.columns
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue