mirror of https://github.com/python/cpython
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
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue