summaryrefslogtreecommitdiffstats
path: root/Lib/dummy_thread.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/dummy_thread.py')
-rw-r--r--Lib/dummy_thread.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/dummy_thread.py b/Lib/dummy_thread.py
index fb3abbf..d69d840 100644
--- a/Lib/dummy_thread.py
+++ b/Lib/dummy_thread.py
@@ -113,6 +113,14 @@ class LockType(object):
self.locked_status = True
return True
+ __enter__ = acquire
+
+ def __exit__(self, typ, val, tb):
+ self.release()
+
+ def __context__(self):
+ return self
+
def release(self):
"""Release the dummy lock."""
# XXX Perhaps shouldn't actually bother to test? Could lead