Skip to content

Commit

Permalink
BUG: Fixed tput output on windows (#16496)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAugspurger authored and jreback committed May 30, 2017
1 parent e60dc4c commit 7efc4e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/source/whatsnew/v0.20.2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Performance Improvements
Bug Fixes
~~~~~~~~~

- Silenced a warning on some Windows environments about "tput: terminal attributes: No such device or address" when
detecting the terminal size. This fix only applies to python 3 (:issue:`16496`)
- Bug in using ``pathlib.Path`` or ``py.path.local`` objects with io functions (:issue:`16291`)
- Bug in ``DataFrame.update()`` with ``overwrite=False`` and ``NaN values`` (:issue:`15593`)

Expand Down
6 changes: 6 additions & 0 deletions pandas/io/formats/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from __future__ import print_function

import os
import sys
import shutil

__all__ = ['get_terminal_size']

Expand All @@ -26,6 +28,10 @@ def get_terminal_size():
IPython zmq frontends, or IDLE do not run in a terminal,
"""
import platform

if sys.version_info[0] >= 3:
return shutil.get_terminal_size()

current_os = platform.system()
tuple_xy = None
if current_os == 'Windows':
Expand Down

0 comments on commit 7efc4e8

Please sign in to comment.