__enter__

LockMgr.__enter__()[source]

When LockMgr is used as a context manager, i.e. with LockManager('xyz') as l: - this method is called to setup the context manager and return the object used for the with statement.

This function simply creates the lock specified by the user to __init__() - then when the context manager is finished, or an exception occurs, __exit__() is called.