diff options
| author | 2020-03-04 08:37:35 +0100 | |
|---|---|---|
| committer | 2020-03-04 08:37:35 +0100 | |
| commit | c12b8e8d84cf8d2ad373c334e5c517d717285e14 (patch) | |
| tree | a9b834e9e6f4b4d777c074533408f25e61fe1dba | |
| parent | Merge pull request #815 from python-discord/watchchannel-dm (diff) | |
Use raw strings for docstrings with forward slashes
A few docstrings in `bot.cogs.extensions` have forward slashed in them to escape Markdown rendering when our help feature uses these docstring in a Discord message. However, the use of forward slashes with an invalid escape sequence in docstrings now raises a DeprecationWarning in Python:
/home/sebastiaan/pydis/repositories/bot/bot/cogs/extensions.py:72: DeprecationWarning: invalid escape sequence \*
PEP 257 (Docstring Conventions, https://www.python.org/dev/peps/pep-0257/) states that raw strings should be used for docstrings that use forward slashes, so I've added the `r`-prefix to the docstrings that use forward slashes.
| -rw-r--r-- | bot/cogs/extensions.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/cogs/extensions.py b/bot/cogs/extensions.py index b312e1a1d..fb6cd9aa3 100644 --- a/bot/cogs/extensions.py +++ b/bot/cogs/extensions.py @@ -69,7 +69,7 @@ class Extensions(commands.Cog): @extensions_group.command(name="load", aliases=("l",)) async def load_command(self, ctx: Context, *extensions: Extension) -> None: - """ + r""" Load extensions given their fully qualified or unqualified names. If '\*' or '\*\*' is given as the name, all unloaded extensions will be loaded. @@ -86,7 +86,7 @@ class Extensions(commands.Cog): @extensions_group.command(name="unload", aliases=("ul",)) async def unload_command(self, ctx: Context, *extensions: Extension) -> None: - """ + r""" Unload currently loaded extensions given their fully qualified or unqualified names. If '\*' or '\*\*' is given as the name, all loaded extensions will be unloaded. @@ -109,7 +109,7 @@ class Extensions(commands.Cog): @extensions_group.command(name="reload", aliases=("r",)) async def reload_command(self, ctx: Context, *extensions: Extension) -> None: - """ + r""" Reload extensions given their fully qualified or unqualified names. If an extension fails to be reloaded, it will be rolled-back to the prior working state. |