mirror of
https://github.com/python/cpython.git
synced 2025-08-28 04:35:02 +00:00
Um, I thought I'd already checked this in.
Anyway, this is the changes to the with-statement so that __exit__ must return a true value in order for a pending exception to be ignored. The PEP (343) is already updated.
This commit is contained in:
parent
692cdbc5d6
commit
f669436189
11 changed files with 61 additions and 106 deletions
|
@ -128,8 +128,6 @@ class _RLock(_Verbose):
|
|||
|
||||
def __exit__(self, t, v, tb):
|
||||
self.release()
|
||||
if t is not None:
|
||||
raise t, v, tb
|
||||
|
||||
# Internal methods used by condition variables
|
||||
|
||||
|
@ -190,8 +188,6 @@ class _Condition(_Verbose):
|
|||
|
||||
def __exit__(self, t, v, tb):
|
||||
self.release()
|
||||
if t is not None:
|
||||
raise t, v, tb
|
||||
|
||||
def __repr__(self):
|
||||
return "<Condition(%s, %d)>" % (self.__lock, len(self.__waiters))
|
||||
|
@ -321,8 +317,6 @@ class _Semaphore(_Verbose):
|
|||
|
||||
def __exit__(self, t, v, tb):
|
||||
self.release()
|
||||
if t is not None:
|
||||
raise t, v, tb
|
||||
|
||||
|
||||
def BoundedSemaphore(*args, **kwargs):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue