fix: 天气查询失败的问题

This commit is contained in:
远野千束 2024-04-15 20:46:09 +08:00
parent 016fe3ef72
commit c4db4dc6a6

View File

@ -27,14 +27,15 @@ def update_liteyuki() -> tuple[bool, str]:
logs = "" logs = ""
# 对每个远程仓库进行更新 # 对每个远程仓库进行更新
for remote_url in remote_urls: for remote_url in remote_urls:
logs += f"\nremote: {remote_url}" try:
repo.remotes.origin.set_url(remote_url) logs += f"\nremote: {remote_url}"
repo.remotes.origin.pull() repo.remotes.origin.set_url(remote_url)
diffs = repo.head.commit.diff("origin/main") repo.remotes.origin.pull()
diffs = repo.head.commit.diff("origin/main")
for diff in diffs.iter_change_type('M'): for diff in diffs.iter_change_type('M'):
logs += f"\n{diff.a_path}" logs += f"\n{diff.a_path}"
return True, logs return True, logs
except:
continue
else: else:
return False, "Nothing Changed" return False, "Nothing Changed"