mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-07 09:52:30 -05:00
Prevent PyPI's unavailability from causing command failure (#3663)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import asyncio
|
||||
import contextlib
|
||||
import sys
|
||||
import codecs
|
||||
@@ -84,7 +85,7 @@ def init_events(bot, cli_flags):
|
||||
INFO.append("{} cogs with {} commands".format(len(bot.cogs), len(bot.commands)))
|
||||
|
||||
outdated_red_message = ""
|
||||
with contextlib.suppress(aiohttp.ClientError, discord.HTTPException):
|
||||
with contextlib.suppress(aiohttp.ClientError, asyncio.TimeoutError):
|
||||
async with aiohttp.ClientSession() as session:
|
||||
async with session.get("https://pypi.org/pypi/red-discordbot/json") as r:
|
||||
data = await r.json()
|
||||
|
||||
Reference in New Issue
Block a user