Skip to content

Commit

Permalink
Use an else clause on a for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
brettcannon authored May 31, 2018
1 parent e2f8ee2 commit 6d2d390
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion news/announce.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,11 @@ def main(run_type, directory):

if __name__ == '__main__':
arguments = docopt.docopt(__doc__)
run_type = RunType.interim
for possible_run_type in RunType:
if arguments[f"--{possible_run_type.name}"]:
run_type = possible_run_type
break
else:
run_type = RunType.interim
directory = arguments["<directory>"] or pathlib.Path(__file__).parent
main(run_type, directory)

0 comments on commit 6d2d390

Please sign in to comment.