Permalink
Browse files

BUGFIX: Incorrect deletion from set 'inprogress'

  • Loading branch information...
maharjun committed Jun 1, 2017
1 parent b700f5c commit eda6e084f02469838005b0051e95a1bb887e924a
Showing with 8 additions and 1 deletion.
  1. +8 −1 scoop/_types.py
View
@@ -105,6 +105,13 @@ def __lt__(self, other):
"""Order futures by creation time."""
return self.creationTime < other.creationTime
+ def __eq__(self, other):
+ # This uses he fact that id's are unique
+ return self.id == other.id
+
+ def __hash__(self):
+ return hash(self.id)
+
def __repr__(self):
"""Convert future to string."""
try:
@@ -246,7 +253,7 @@ def _execute_callbacks(self, callbackType=CallbackType.standard):
def _delete(self):
# TODO: Do we need this?
# discard: remove if exists
- scoop._control.execQueue.inprogress.discard(self.id)
+ scoop._control.execQueue.inprogress.discard(self)
for child in self.children:
child.exceptionValue = CancelledError()
scoop._control.delFuture(self)

0 comments on commit eda6e08

Please sign in to comment.