From 077696459001948ccaba11c0cc0a10ea3b97775c Mon Sep 17 00:00:00 2001 From: Paillat Date: Wed, 20 Nov 2024 22:22:10 +0100 Subject: [PATCH] :goal_net: Use `contextlib.suppress` instead of `try:` `except: pass` --- discord/abc.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/discord/abc.py b/discord/abc.py index 2403391961..a66ebd0d92 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -26,6 +26,7 @@ from __future__ import annotations import asyncio +import contextlib import copy import time from typing import ( @@ -417,10 +418,8 @@ async def _edit( except KeyError: pass - try: + with contextlib.suppress(KeyError): options["flags"] = options.pop("flags").value - except KeyError: - pass try: options["available_tags"] = [