Skip to content

Commit

Permalink
🥅 Use contextlib.suppress instead of try: except: pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Paillat-dev committed Nov 20, 2024
1 parent 0b3f756 commit 0776964
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions discord/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from __future__ import annotations

import asyncio
import contextlib
import copy
import time
from typing import (
Expand Down Expand Up @@ -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"] = [
Expand Down

0 comments on commit 0776964

Please sign in to comment.