From d278df09f7dcb6d5b91863886cb923e9598eaf76 Mon Sep 17 00:00:00 2001 From: sugoidogo Date: Sun, 14 Dec 2025 22:16:59 -0800 Subject: [PATCH] don't fail for update check --- astrolobot.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/astrolobot.py b/astrolobot.py index 96447f6..b3ff1ed 100755 --- a/astrolobot.py +++ b/astrolobot.py @@ -10,18 +10,21 @@ import json,sys,webbrowser,importlib,tomllib def update(): print('checking for updates...') - with open(script_path()+'astrolobot.py','r') as file: - current_script=file.read() - urlretrieve( - 'https://gitea.sugoidogo.com/SugoiDogo/astrolobot/releases/download/latest/astrolobot.py', - script_path()+'astrolobot.py' - ) - with open(script_path()+'astrolobot.py','r') as file: - updated_script=file.read() - if current_script==updated_script: - print('up to date') - else: - print('update downloaded, restart script to apply') + try: + with open(script_path()+'astrolobot.py','r') as file: + current_script=file.read() + urlretrieve( + 'https://gitea.sugoidogo.com/SugoiDogo/astrolobot/releases/download/latest/astrolobot.py', + script_path()+'astrolobot.py' + ) + with open(script_path()+'astrolobot.py','r') as file: + updated_script=file.read() + if current_script==updated_script: + print('up to date') + else: + print('update downloaded, restart script to apply') + except: + print('update check failed, ignoring') def dependency_setup(): if not path.exists(script_path()+'pip'):