Thanks to visit codestin.com Credit goes to github.com
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 1104a9f commit 9ff569cCopy full SHA for 9ff569c
mypy/util.py
@@ -542,7 +542,14 @@ def initialize_unix_colors(self) -> bool:
542
if not CURSES_ENABLED:
543
return False
544
try:
545
- curses.setupterm()
+ # setupterm wants a fd to potentially write an "initialization sequence".
546
+ # We override sys.stdout for the daemon API so if stdout doesn't have an fd,
547
+ # just give it /dev/null.
548
+ if hasattr(sys.stdout, 'fileno'):
549
+ curses.setupterm()
550
+ else:
551
+ with open("/dev/null", "rb") as f:
552
+ curses.setupterm(fd=f.fileno())
553
except curses.error:
554
# Most likely terminfo not found.
555
0 commit comments