Commit 37a10853 authored by Michael Büsch's avatar Michael Büsch

util: Add no-op context manager

Signed-off-by: Michael Büsch's avatarMichael Buesch <m@bues.ch>
parent 238c72d0
......@@ -291,3 +291,14 @@ def toList(value):
if isiterable(value):
return list(value)
return [ value, ]
class nopContextManager(object):
"""No-operation context manager.
"""
def __enter__(self):
return None
def __exit__(self, exctype, excinst, exctb):
return False
nopContext = nopContextManager()
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