-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
321 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
from contextlib import contextmanager,redirect_stderr,redirect_stdout | ||
from contextlib import contextmanager, redirect_stderr, redirect_stdout | ||
from os import devnull | ||
|
||
|
||
@contextmanager | ||
def suppress_stdout_stderr(): | ||
"""A context manager that redirects stdout and stderr to devnull""" | ||
with open(devnull, 'w') as fnull: | ||
with open(devnull, "w") as fnull: | ||
with redirect_stderr(fnull) as err, redirect_stdout(fnull) as out: | ||
yield (err, out) | ||
yield (err, out) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.