Clean up syntax for supported Python versions. (#1963)

* Use set/dict literal syntax

Ran code through [pyupgrade](https://github.com/asottile/pyupgrade). This is
supported in every Python version 2.7+.

* Drop unnecessary string format specification

No need to specify 0,1.. if paramters are passed in order.

* Revert "Drop unnecessary string format specification"

This reverts commit efa5ec85d30ff69f34e5ed93e31343fea7647bcb.

* Undo changes to cloudpickle

Drop use of set literal until cloudpickle uses it.

* Reformat code with YAPF

We need to set up a git pre-push hook to automatically run this stuff.
This commit is contained in:
Alok Singh
2018-05-03 07:45:12 -07:00
committed by Philipp Moritz
parent d85ee0bc04
commit cdf94c18a4
11 changed files with 41 additions and 37 deletions
+5 -3
View File
@@ -464,9 +464,11 @@ class Worker(object):
final_results = self.retrieve_and_deserialize(plain_object_ids, 0)
# Construct a dictionary mapping object IDs that we haven't gotten yet
# to their original index in the object_ids argument.
unready_ids = dict((plain_object_ids[i].binary(), i)
for (i, val) in enumerate(final_results)
if val is plasma.ObjectNotAvailable)
unready_ids = {
plain_object_ids[i].binary(): i
for (i, val) in enumerate(final_results)
if val is plasma.ObjectNotAvailable
}
was_blocked = (len(unready_ids) > 0)
# Try reconstructing any objects we haven't gotten yet. Try to get them
# until at least get_timeout_milliseconds milliseconds passes, then