Skip to content

Commit

Permalink
if empty check is replaced by or
Browse files Browse the repository at this point in the history
args = args or [] simplifies checking if args is None to a single line, using short-circuit evaluation. kwargs = kwargs or {} does the same for kwargs.

Signed-off-by: changxuqing <[email protected]>
  • Loading branch information
changxuqing committed Jul 18, 2023
1 parent 179c0a8 commit 96514d3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions avocado/utils/wait.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ def wait_for(func, timeout, first=0.0, step=1.0, text=None, args=None, kwargs=No
:param args: Positional arguments to func
:param kwargs: Keyword arguments to func
"""
if args is None:
args = []
if kwargs is None:
kwargs = {}
args = args or []
kwargs = kwargs or {}
start_time = time.monotonic()
end_time = start_time + timeout

Expand Down

0 comments on commit 96514d3

Please sign in to comment.