From dab1c8b6cea01ed94534a3665961ad3849a04dd7 Mon Sep 17 00:00:00 2001 From: alessandrofelder Date: Fri, 24 Jan 2025 15:29:36 +0000 Subject: [PATCH] fix try-except in conf_from_url --- brainglobe_atlasapi/utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/brainglobe_atlasapi/utils.py b/brainglobe_atlasapi/utils.py index 464d69a3..562c562a 100644 --- a/brainglobe_atlasapi/utils.py +++ b/brainglobe_atlasapi/utils.py @@ -316,9 +316,10 @@ def conf_from_url(url) -> configparser.ConfigParser: if status_code == 200: break except requests.exceptions.ConnectionError: - max_tries -= 1 - sleep(sleep_time) - sleep_time *= 2 + pass # keep trying to connect + max_tries -= 1 + sleep(sleep_time) + sleep_time *= 2 if status_code != 200: print(f"Could not fetch the latest atlas versions: {status_code}")