Skip to content

Commit 2a42669

Browse files
committed
Use enum.member instead of functools.partial workaround
The workaround would no longer work in future versions
1 parent a7cf6c8 commit 2a42669

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

bot/exts/core/extensions.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import functools
21
from collections.abc import Mapping
3-
from enum import Enum
2+
from enum import Enum, member
43

54
from discord import Colour, Embed
65
from discord.ext import commands
@@ -24,10 +23,9 @@
2423
class Action(Enum):
2524
"""Represents an action to perform on an extension."""
2625

27-
# Need to be partial otherwise they are considered to be function definitions.
28-
LOAD = functools.partial(Bot.load_extension)
29-
UNLOAD = functools.partial(Bot.unload_extension)
30-
RELOAD = functools.partial(Bot.reload_extension)
26+
LOAD = member(Bot.load_extension)
27+
UNLOAD = member(Bot.unload_extension)
28+
RELOAD = member(Bot.reload_extension)
3129

3230

3331
class Extension(commands.Converter):

0 commit comments

Comments
 (0)