mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
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.
This commit is contained in:
parent
e4292c0410
commit
43ad3b5170
1 changed files with 1 additions and 1 deletions
|
|
@ -1806,7 +1806,7 @@ def _isatty_open_only(self):
|
|||
"""
|
||||
if (self._stat_atopen is not None
|
||||
and not stat.S_ISCHR(self._stat_atopen.st_mode)):
|
||||
return True
|
||||
return False
|
||||
return os.isatty(self._fd)
|
||||
|
||||
@property
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue