Condition.wait() modifies self._waiters without holding the lock (when a wait with timeout times out without the condition being notified). If this happens to occur in between construction of the _islice and _deque objects in Condition.notify(): def notify(self, n=1): [...] all_waiters = self._waiters waiters_to_notify = _deque(_islice(all_waiters, n)) then the result is a RuntimeError exception: File "/usr/lib/python3.4/threading.py", line 358, in notify_all self.notify(len(self._waiters)) File "/usr/lib/python3.4/threading.py", line 341, in notify waiters_to_notify = _deque(_islice(all_waiters, n)) RuntimeError: deque mutated during iteration (I have a server which makes extensive use of conditions on which this happens about once a day.) This patch fixes this bug by moving wait()'s modification of self._waiters to be inside the lock, as suggested by Antoine Pitrou here: http://bugs.python.org/issue17385#msg183875