Skip to content

Commit

Permalink
Use try/except instead of testing for attribute existence.
Browse files Browse the repository at this point in the history
"It's better to ask forgiveness than permission", or so they say.
  • Loading branch information
riccardomurri committed Nov 22, 2016
1 parent 2326644 commit 75661ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gc3libs/cmdline.py
Expand Up @@ -1031,9 +1031,12 @@ def _fix_output_dir(self, task, name):
except AttributeError:
# no subtasks
pass
if 'task' in task:
try:
# RetryableTask
self._fix_output_dir(task.task, name)
except AttributeError:
# not a RetryableTask
pass

def setup_common_options(self, parser):
# 1. job requirements
Expand Down

0 comments on commit 75661ae

Please sign in to comment.