[issue3957] [contextlib] Reverse order of locking

David Naylor report at bugs.python.org
Wed Sep 24 17:03:26 CEST 2008

David Naylor <naylor.b.david at gmail.com> added the comment:

Apologies, obviously the invert function should be preceded by an 
@contextmanager to become:

def invert(thing):
  thing.__exit__(None, None, None)
  yield thing

[Although there may be a better way of doing this, perhaps as a 

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list