Fix linting errors. (#3127)

This commit is contained in:
Robert Nishihara
2018-10-24 16:30:00 -07:00
committed by Philipp Moritz
parent 55d161b49f
commit 5aa29613db
12 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ matrix:
- sphinx-build -W -b html -d _build/doctrees source _build/html
- cd ..
# Run Python linting, ignore dict vs {} (C408), others are defaults
- flake8 --exclude=python/ray/core/src/common/flatbuffers_ep-prefix/,python/ray/core/generated/,src/common/format/,doc/source/conf.py,python/ray/cloudpickle/ --ignore=C408,E121,E123,E126,E226,E24,E704,W503,W504
- flake8 --exclude=python/ray/core/src/common/flatbuffers_ep-prefix/,python/ray/core/generated/,src/common/format/,doc/source/conf.py,python/ray/cloudpickle/ --ignore=C408,E121,E123,E126,E226,E24,E704,W503,W504,W605
- .travis/format.sh --all
- os: linux
+1 -1
View File
@@ -908,7 +908,7 @@ class GlobalState(object):
repr(arg)
for arg in task_table[task_id]["TaskSpec"]["Args"]
]
except Exception as e:
except Exception:
print("Could not find task {}".format(task_id))
# filter out tasks not in task_table
+1 -1
View File
@@ -163,7 +163,7 @@ class FunctionActorManager(object):
try:
function = pickle.loads(serialized_function)
except Exception as e:
except Exception:
# If an exception was thrown when the remote function was imported,
# we record the traceback and notify the scheduler of the failure.
traceback_str = format_error_message(traceback.format_exc())
@@ -70,7 +70,7 @@ def check_support(alg, config, stats, check_bounds=False):
try:
a = get_agent_class(alg)(config=config, env="stub_env")
a.train()
except UnsupportedSpaceException as e:
except UnsupportedSpaceException:
stat = "unsupported"
except Exception as e:
stat = "ERROR"
+1 -1
View File
@@ -225,7 +225,7 @@ def start(node_ip_address, redis_address, redis_port, num_redis_shards,
try:
resources = json.loads(resources)
except Exception as e:
except Exception:
raise Exception("Unable to parse the --resources argument using "
"json.loads. Try using a format like\n\n"
" --resources='{\"CustomResource1\": 3, "
+1 -1
View File
@@ -335,7 +335,7 @@ def wait_for_redis_to_start(redis_ip_address,
"Waiting for redis server at {}:{} to respond...".format(
redis_ip_address, redis_port))
redis_client.client_list()
except redis.ConnectionError as e:
except redis.ConnectionError:
# Wait a little bit.
time.sleep(1)
logger.info("Failed to connect to the redis server, retrying.")
+1 -1
View File
@@ -10,7 +10,7 @@ try:
hyperopt_logger = logging.getLogger("hyperopt")
hyperopt_logger.setLevel(logging.WARNING)
import hyperopt as hpo
except Exception as e:
except Exception:
hpo = None
from ray.tune.error import TuneError
+1 -1
View File
@@ -2387,7 +2387,7 @@ def register_custom_serializer(cls,
# worker. However, determinism is not guaranteed, and the
# result may be different on different workers.
class_id = _try_to_compute_deterministic_class_id(cls)
except Exception as e:
except Exception:
raise serialization.CloudPickleError("Failed to pickle class "
"'{}'".format(cls))
else:
+1 -1
View File
@@ -106,7 +106,7 @@ if __name__ == "__main__":
# main_loop. If an exception is thrown here, then that means that
# there is some error that we didn't anticipate.
ray.worker.global_worker.main_loop()
except Exception as e:
except Exception:
traceback_str = traceback.format_exc() + error_explanation
ray.utils.push_error_to_driver(
ray.worker.global_worker,
+1 -1
View File
@@ -98,7 +98,7 @@ class build_ext(_build_ext.build_ext):
for filename in optional_ray_files:
try:
self.move_file(filename)
except Exception as e:
except Exception:
print("Failed to copy optional file {}. This is ok."
.format(filename))
@@ -50,7 +50,7 @@ def driver(redis_address, driver_index):
while time.time() - start_time < timeout:
try:
actor = actor_class.remote()
except Exception as e:
except Exception:
time.sleep(0.1)
else:
return actor
@@ -199,7 +199,7 @@ def cleanup_driver(redis_address, driver_index):
try:
actor = actor_class.remote(driver_index, actor_index,
redis_address)
except Exception as e:
except Exception:
time.sleep(0.1)
else:
return actor