Skip to content

Commit

Permalink
Merge pull request ipython#2829 from minrk/nodate
Browse files Browse the repository at this point in the history
avoid comparison error in dictdb hub 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 23, 2013
2 parents 1c98c91 + 7b809f7 commit c4dfa24
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 c4dfa24

Please sign in to comment.