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:
Cody Maloney 2024-10-08 04:49:50 -07:00 committed by GitHub
parent e4292c0410
commit 43ad3b5170
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -1806,7 +1806,7 @@ class FileIO(RawIOBase):
"""
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