You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def __enter__(self):
"""
You can use the lock as a contextmanager
"""
self.acquire(blocking=True, lock_ttl=0)
# missing return self
def __exit__(self, type, value, traceback):
self.release()
# missing return False
The text was updated successfully, but these errors were encountered:
According to the documentation at http://python-etcd.readthedocs.io/en/latest/, the following code should be valid usage of the Lock class:
This throws an AttributeError at my_lock.is_acquired(), because my_lock is None at that point.
The reason is the implementation of enter and exit on Lock, which do not comply with the context manager contract, see https://docs.python.org/2/reference/datamodel.html#context-managers.
e.g.
The text was updated successfully, but these errors were encountered: