Skip to content

Instantly share code, notes, and snippets.

@dmyersturnbull
Created May 5, 2020 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmyersturnbull/71eef01bb854dc41e8a3922601e8d1cd to your computer and use it in GitHub Desktop.
Save dmyersturnbull/71eef01bb854dc41e8a3922601e8d1cd to your computer and use it in GitHub Desktop.
Fake writer (to devnull).
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