This instance will be upgraded to Heptapod 0.31.0rc on 2022-05-19 at 11:00 UTC+2 (a few minutes of down time)

Commit 93faa1c1 authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Made Users be context managers

parent db88bce4c219
......@@ -240,3 +240,10 @@ class User(object):
logger.info("%r: access token generated in %.2f seconds",
self, time.time() - start)
def __enter__(self):
return self
def __exit__(self, *exc_args):
self.delete()
return False
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