Skip to content

Commit

Permalink
remove unnecessary exception handling
Browse files Browse the repository at this point in the history
when we switched to argparse module, the usage() subroutine was
removed from the parse_slave.py but the exception handler still
called it.  Since the exception handler itself added no value,
just remove it and let the IOError exception propagate.
  • Loading branch information
bengland2 committed Oct 14, 2018
1 parent f62de49 commit c2c189c
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions parse_slave.py
Expand Up @@ -35,15 +35,9 @@ def parse():
if not os.path.exists(param_pickle_fname):
time.sleep(1.1)
params = None
try:
with open(param_pickle_fname, 'rb') as pickled_params:
params = pickle.load(pickled_params)
params.is_slave = True
params.as_host = args.as_host
params.master_invoke.onhost = args.as_host
except IOError as e:
if e.errno != errno.ENOENT:
raise e
usage('could not read parameter pickle file %s'
% param_pickle_fname)
with open(param_pickle_fname, 'rb') as pickled_params:
params = pickle.load(pickled_params)
params.is_slave = True
params.as_host = args.as_host
params.master_invoke.onhost = args.as_host
return params

0 comments on commit c2c189c

Please sign in to comment.