Skip to content

Commit 339505e

Browse files
authored
Redirect output to /dev/null (#2880)
* Redirect output to devnull Fixes #2877, #2878 and #2879. * Rename file handle * Reformat
1 parent 21d0916 commit 339505e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/textual/app.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1978,8 +1978,10 @@ async def invoke_ready_callback() -> None:
19781978
with redirect_stdout(redirector): # type: ignore
19791979
await run_process_messages()
19801980
else:
1981-
with redirect_stderr(None):
1982-
with redirect_stdout(None):
1981+
with open(os.devnull, "w") as null_file:
1982+
with redirect_stdout(null_file), redirect_stderr(
1983+
null_file
1984+
):
19831985
await run_process_messages()
19841986

19851987
finally:

0 commit comments

Comments
 (0)