Commit bf48ee7c by willmcgugan

Added context manager methods to NullFile

parent c638a2e9
......@@ -89,12 +89,18 @@ class NullFile(object):
def __init__(self):
self.closed = False
def flush(self):
pass
def __iter__(self):
return self
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
self.closed = True
def flush(self):
pass
def next(self):
raise StopIteration
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment