mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
dummy_thread needs to support PEP 343 too.
This commit is contained in:
parent
b6e92c40a9
commit
849974fb56
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue