Skip to content

gh-121927: Fix io.UnsupportedOperation: fileno exception in test_pyrepl #121928

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

Closed
wants to merge 1 commit into from
Closed
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
18 changes: 14 additions & 4 deletions Lib/test/test_pyrepl/test_pyrepl.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,14 +491,24 @@ def prepare_reader(self, events):

def test_stdin_is_tty(self):
# Used during test log analysis to figure out if a TTY was available.
if os.isatty(sys.stdin.fileno()):
return
try:
fileno = sys.stdin.fileno()
except OSError:
pass
else:
if os.isatty(fileno):
return
self.skipTest("stdin is not a tty")

def test_stdout_is_tty(self):
# Used during test log analysis to figure out if a TTY was available.
if os.isatty(sys.stdout.fileno()):
return
try:
fileno = sys.stdout.fileno()
except OSError:
pass
else:
if os.isatty(fileno):
return
self.skipTest("stdout is not a tty")

def test_basic(self):
Expand Down
Loading