summaryrefslogtreecommitdiffstats
path: root/Lib/_pyio.py
diff options
context:
space:
mode:
authorCody Maloney <cmaloney@users.noreply.github.com>2024-10-08 11:49:50 (GMT)
committerGitHub <noreply@github.com>2024-10-08 11:49:50 (GMT)
commit43ad3b51707f51ae4b434e2b5950d2c8bf7cca6e (patch)
tree7797f9403c1a7c7c7ea1d3981bd0d72c3313261a /Lib/_pyio.py
parente4292c041018dd9e831e541b515fec1119f92690 (diff)
downloadcpython-43ad3b51707f51ae4b434e2b5950d2c8bf7cca6e.zip
cpython-43ad3b51707f51ae4b434e2b5950d2c8bf7cca6e.tar.gz
cpython-43ad3b51707f51ae4b434e2b5950d2c8bf7cca6e.tar.bz2
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.
Diffstat (limited to 'Lib/_pyio.py')
-rw-r--r--Lib/_pyio.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/_pyio.py b/Lib/_pyio.py
index 2a1d2a3..7b6d10c 100644
--- a/Lib/_pyio.py
+++ b/Lib/_pyio.py
@@ -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