We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15c840a commit 73a4fb1Copy full SHA for 73a4fb1
Lib/traceback.py
@@ -155,11 +155,16 @@ def _can_colorize():
155
return True
156
if os.environ.get("TERM") == "dumb":
157
return False
158
+
159
+ if not hasattr(sys.stderr, "fileno"):
160
+ return False
161
162
try:
163
return os.isatty(sys.stderr.fileno())
164
except io.UnsupportedOperation:
165
return sys.stderr.isatty()
166
167
168
def _print_exception_bltin(exc, /):
169
file = sys.stderr if sys.stderr is not None else sys.__stderr__
170
colorize = _can_colorize()
0 commit comments