Skip to content

Commit

Permalink
avoid comparison error in dictdb hub history
Browse files Browse the repository at this point in the history
in rare situations, display data can arrive at the Hub before the execution request, in which case `submitted` is undefined.

should address ipython#2821, but I need to see Jenkins succeed,
since that is the only place this comes up.
  • Loading branch information
minrk committed Jan 22, 2013
1 parent 42886e3 commit 09b79c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion IPython/parallel/controller/dictdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,11 @@ def find_records(self, check, keys=None):

def get_history(self):
"""get all msg_ids, ordered by time submitted."""
msg_ids = self._records.keys()
msg_ids = self._records.keys():
# Remove any that do not have a submitted timestamp.
# This is extremely unlikely to happen,
# but it seems to come up in some tests on VMs.
msg_ids = [ m for m in msg_ids if self._records[m]['submitted'] is not None ]
return sorted(msg_ids, key=lambda m: self._records[m]['submitted'])


Expand Down

0 comments on commit 09b79c3

Please sign in to comment.