Skip to content

Commit

Permalink
Replace conditional with builtin max (#12122)
Browse files Browse the repository at this point in the history
It is unnecessary to use an if statement to check the maximum of two values and then assign the value to a name. Just using the max built-in is straightforward and more readable.
  • Loading branch information
kaxil committed Nov 6, 2020
1 parent 356dc0b commit a83be66
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions airflow/providers/jenkins/operators/jenkins_job_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@ def __init__(
super().__init__(**kwargs)
self.job_name = job_name
self.parameters = parameters
if sleep_time < 1:
sleep_time = 1
self.sleep_time = sleep_time
self.sleep_time = max(sleep_time, 1)
self.jenkins_connection_id = jenkins_connection_id
self.max_try_before_job_appears = max_try_before_job_appears

Expand Down

0 comments on commit a83be66

Please sign in to comment.