From ae22468fecfdba50be99cf715405458c0c824306 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 23 May 2018 18:10:23 -0400 Subject: [PATCH] fix CallLaterManager trying to remove pending calls multiple times --- lbrynet/core/call_later_manager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lbrynet/core/call_later_manager.py b/lbrynet/core/call_later_manager.py index 2bf858a40..de7395322 100644 --- a/lbrynet/core/call_later_manager.py +++ b/lbrynet/core/call_later_manager.py @@ -38,7 +38,8 @@ class CallLaterManager(object): if call_later.active(): call_later.cancel() - cls._pendingCallLaters.remove(call_later) + if call_later in cls._pendingCallLaters: + cls._pendingCallLaters.remove(call_later) return reason return cancel @@ -53,7 +54,7 @@ class CallLaterManager(object): canceller = cls._cancel(cls._pendingCallLaters[0]) try: canceller() - except (defer.CancelledError, defer.AlreadyCalledError): + except (defer.CancelledError, defer.AlreadyCalledError, ValueError): pass @classmethod