aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/utils/extensions.py
diff options
context:
space:
mode:
authorGravatar Xithrius <[email protected]>2021-09-03 00:31:12 -0700
committerGravatar GitHub <[email protected]>2021-09-03 00:31:12 -0700
commitea47bc617e558929bcee39e6008a57d6dd814aa1 (patch)
treec40e2f23e55119fb33f83271d227103cb9be7c6f /bot/exts/utils/extensions.py
parentImproved consistency for codeblocks to end with a newline (diff)
parentMerge pull request #802 from python-discord/decorator-factory/typehints-fix (diff)
Merge branch 'main' into android-codeblock-fix
Diffstat (limited to 'bot/exts/utils/extensions.py')
-rw-r--r--bot/exts/utils/extensions.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/bot/exts/utils/extensions.py b/bot/exts/utils/extensions.py
index 2f72a302..424bacac 100644
--- a/bot/exts/utils/extensions.py
+++ b/bot/exts/utils/extensions.py
@@ -1,7 +1,8 @@
import functools
import logging
-import typing as t
+from collections.abc import Mapping
from enum import Enum
+from typing import Optional
from discord import Colour, Embed
from discord.ext import commands
@@ -170,7 +171,7 @@ class Extensions(commands.Cog):
log.debug(f"{ctx.author} requested a list of all cogs. Returning a paginated list.")
await LinePaginator.paginate(lines, ctx, embed, max_size=1200, empty=False)
- def group_extension_statuses(self) -> t.Mapping[str, str]:
+ def group_extension_statuses(self) -> Mapping[str, str]:
"""Return a mapping of extension names and statuses to their categories."""
categories = {}
@@ -219,7 +220,7 @@ class Extensions(commands.Cog):
return msg
- def manage(self, action: Action, ext: str) -> t.Tuple[str, t.Optional[str]]:
+ def manage(self, action: Action, ext: str) -> tuple[str, Optional[str]]:
"""Apply an action to an extension and return the status message and any error message."""
verb = action.name.lower()
error_msg = None