Skip to content

Commit 43ad3b5

Browse files
authored
gh-90102: Fix pyio _isatty_open_only() (#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 e4292c0 commit 43ad3b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)