Skip to content

Replace deprecated py.io.get_terminal_width() with shutil.get_terminal_size() #116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pytest_timeout.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"""
import inspect
import os
import shutil
import signal
import sys
import threading
import traceback
from collections import namedtuple

import py
import pytest


Expand Down Expand Up @@ -444,7 +444,7 @@ def write_title(title, stream=None, sep="~"):
"""
if stream is None:
stream = sys.stderr
width = py.io.get_terminal_width()
width, height = shutil.get_terminal_size()
fill = int((width - len(title) - 2) / 2)
line = " ".join([sep * fill, title, sep * fill])
if len(line) < width:
Expand Down