diff options
| author | Phillip J. Eby <pje@telecommunity.com> | 2006-03-27 23:32:10 +0000 |
|---|---|---|
| committer | Phillip J. Eby <pje@telecommunity.com> | 2006-03-27 23:32:10 +0000 |
| commit | 849974fb560e6d7d508b9fc2eaf45f070dd72062 (patch) | |
| tree | 27f024b004532c4153f19b086920710d782f93e4 | |
| parent | b6e92c40a97c3bd6ec6420cdd0d21c1d7ef45817 (diff) | |
| download | cpython-git-849974fb560e6d7d508b9fc2eaf45f070dd72062.tar.gz | |
dummy_thread needs to support PEP 343 too.
| -rw-r--r-- | Lib/dummy_thread.py | 8 |
1 files changed, 8 insertions, 0 deletions
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 |
