Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4b6b7f1

Browse files
committed
Remove calls to currentThread() in _Condition methods that were side-effect.
Side-effects were deemed unnecessary and were causing problems at shutdown time when threads were catching exceptions at start time and then triggering exceptions trying to call currentThread() after gc'ed. Masked the initial exception which was deemed bad. Fixes bug #754449 .
1 parent 3fd500b commit 4b6b7f1

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

Lib/threading.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ def _is_owned(self):
193193
return True
194194

195195
def wait(self, timeout=None):
196-
currentThread() # for side-effect
197196
assert self._is_owned(), "wait() of un-acquire()d lock"
198197
waiter = _allocate_lock()
199198
waiter.acquire()
@@ -235,7 +234,6 @@ def wait(self, timeout=None):
235234
self._acquire_restore(saved_state)
236235

237236
def notify(self, n=1):
238-
currentThread() # for side-effect
239237
assert self._is_owned(), "notify() of un-acquire()d lock"
240238
__waiters = self.__waiters
241239
waiters = __waiters[:n]

0 commit comments

Comments
 (0)