Commit a3896330 authored by Brian May's avatar Brian May

Merge pull request #10 from jbd/patch-1

Check for fileno attribute in _tty_width function
parents 00f20657 bbd54e15
...@@ -61,6 +61,8 @@ def _remove_negative_k(k): ...@@ -61,6 +61,8 @@ def _remove_negative_k(k):
def _tty_width(): def _tty_width():
if not hasattr(sys.stderr, "fileno"):
return _atoi(os.environ.get('WIDTH')) or 70
s = struct.pack("HHHH", 0, 0, 0, 0) s = struct.pack("HHHH", 0, 0, 0, 0)
try: try:
import fcntl import fcntl
......
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