Created
May 5, 2020 01:27
-
-
Save dmyersturnbull/71eef01bb854dc41e8a3922601e8d1cd to your computer and use it in GitHub Desktop.
Fake writer (to devnull).
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
class DevNull: | |
"""Pretends to write but doesn't.""" | |
def write(self, msg): | |
pass | |
def flush(self): | |
pass | |
def close(self): | |
pass | |
def __enter__(self): | |
return self | |
def __exit__(self, exc_type, exc_value, traceback): | |
self.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment