Skip to content

Commit 148e3fe

Browse files
cmaloneyefimov-mikhail
authored andcommitted
pythongh-90102: Fix pyio _isatty_open_only() (python#125089)
Spotted by @ngnpope. `isatty` returns False to indicate the file is not a TTY. The C implementation of _io does that (`Py_RETURN_FALSE`) but I got the bool backwards in the _pyio implementaiton.
1 parent c4812df commit 148e3fe

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/_pyio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1806,7 +1806,7 @@ def _isatty_open_only(self):
18061806
"""
18071807
if (self._stat_atopen is not None
18081808
and not stat.S_ISCHR(self._stat_atopen.st_mode)):
1809-
return True
1809+
return False
18101810
return os.isatty(self._fd)
18111811

18121812
@property

0 commit comments

Comments
 (0)