From 849974fb560e6d7d508b9fc2eaf45f070dd72062 Mon Sep 17 00:00:00 2001 From: "Phillip J. Eby" Date: Mon, 27 Mar 2006 23:32:10 +0000 Subject: [PATCH] dummy_thread needs to support PEP 343 too. --- Lib/dummy_thread.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Lib/dummy_thread.py b/Lib/dummy_thread.py index fb3abbf75d..d69d84053d 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 -- 2.40.0