Skip to content

Commit

Permalink
Simplify logic with dict.get() (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss authored and tqchen committed Jul 16, 2018
1 parent 99696ad commit 951835b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tracker/dmlc_tracker/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ def exec_cmd(cmd, role, taskid, pass_env):
env['DMLC_ROLE'] = role
env['DMLC_JOB_CLUSTER'] = 'local'

num_retry = 0
if 'DMLC_NUM_ATTEMPT' in env:
num_retry = env['DMLC_NUM_ATTEMPT']
num_retry = env.get('DMLC_NUM_ATTEMPT', 0)

while True:
if os.name == 'nt':
Expand Down

0 comments on commit 951835b

Please sign in to comment.