From 5edfcf3f8b2b3ac04078435177fe3cca4448ead0 Mon Sep 17 00:00:00 2001 From: "deepsource-autofix[bot]" <62050782+deepsource-autofix[bot]@users.noreply.github.com> Date: Fri, 2 Jul 2021 00:40:42 +0000 Subject: [PATCH] Refactor unnecessary `else` / `elif` when `if` block has a `return` statement --- matcher/race_results.py | 2 +- matcher/sites/sporting_index.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/matcher/race_results.py b/matcher/race_results.py index e377251..b8fa523 100644 --- a/matcher/race_results.py +++ b/matcher/race_results.py @@ -40,7 +40,7 @@ def get_position(venue, time, horse_name): race_id = get_race_id(venue, time) if race_id is None: return "Rate limit exceeded" - elif isinstance(race_id, list): + if isinstance(race_id, list): print("\nCourse not found: %s, %s\n%s" % (venue, time, race_id)) return None diff --git a/matcher/sites/sporting_index.py b/matcher/sites/sporting_index.py index 8598edf..b313cf9 100644 --- a/matcher/sites/sporting_index.py +++ b/matcher/sites/sporting_index.py @@ -138,8 +138,7 @@ def click_horse(driver, horse_name): if cur_odd_price != "SUSP": horse_button.click() return True - else: - print("Horse is SUSP") + print("Horse is SUSP") except WebDriverException: pass return False @@ -272,7 +271,7 @@ def make_bet(driver, race, market_ids=None, selection_id=None, lay=False): return make_bet( driver, race, market_ids=market_ids, selection_id=selection_id, lay=lay ) - elif bet_made: + if bet_made: return True close_bet(driver)