Skip to content

Commit 5920a30

Browse files
style(pre-commit): auto fixes from pre-commit.com hooks
1 parent c6dfebb commit 5920a30

File tree

5 files changed

+11
-13
lines changed

5 files changed

+11
-13
lines changed

discord/__main__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
_log = logging.getLogger(__name__)
3939

40+
4041
def show_version() -> None:
4142
entries = [
4243
"- Python v{0.major}.{0.minor}.{0.micro}-{0.releaselevel}".format(
@@ -240,7 +241,7 @@ def newbot(parser, args) -> None:
240241
cogs.mkdir(exist_ok=True)
241242
init = cogs / "__init__.py"
242243
init.touch()
243-
except OSError as exc:
244+
except OSError:
244245
_log.exception(f"Could not create cogs directory.")
245246

246247
try:
@@ -260,7 +261,7 @@ def newbot(parser, args) -> None:
260261
try:
261262
with open(str(new_directory / ".gitignore"), "w", encoding="utf-8") as fp:
262263
fp.write(_gitignore_template)
263-
except OSError as exc:
264+
except OSError:
264265
_log.exception(f"Could not create .gitignore file.")
265266

266267
print("Successfully made bot at", new_directory)
@@ -270,7 +271,7 @@ def newcog(parser, args) -> None:
270271
cog_dir = to_path(parser, args.directory)
271272
try:
272273
cog_dir.mkdir(exist_ok=True)
273-
except OSError as exc:
274+
except OSError:
274275
_log.exception(f"Could not create cogs directory.")
275276

276277
directory = cog_dir / to_path(parser, args.name)

discord/bot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
import copy
3232
import inspect
3333
import logging
34-
import sys
35-
import traceback
3634
from abc import ABC, abstractmethod
3735
from typing import (
3836
TYPE_CHECKING,
@@ -1255,7 +1253,9 @@ async def on_application_command_error(
12551253
if cog and cog.has_error_handler():
12561254
return
12571255

1258-
_log.error(f"Ignoring exception in command {context.command}.", exc_info=exception)
1256+
_log.error(
1257+
f"Ignoring exception in command {context.command}.", exc_info=exception
1258+
)
12591259

12601260
# global check registration
12611261
# TODO: Remove these from commands.Bot

discord/client.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import asyncio
2929
import logging
3030
import signal
31-
import sys
3231
import traceback
3332
from types import TracebackType
3433
from typing import TYPE_CHECKING, Any, Callable, Coroutine, Generator, Sequence, TypeVar
@@ -569,7 +568,6 @@ async def on_modal_error(self, error: Exception, interaction: Interaction) -> No
569568

570569
_log.error(f"Ignoring exception in modal {interaction.modal}", exc_info=error)
571570

572-
573571
# hooks
574572

575573
async def _call_before_identify_hook(

discord/ext/commands/bot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727

2828
import collections
2929
import collections.abc
30-
import sys
3130
import logging
32-
import traceback
3331
from typing import TYPE_CHECKING, Any, Callable, Coroutine, Iterable, TypeVar
3432

3533
import discord
@@ -175,7 +173,9 @@ async def on_command_error(
175173
if cog and cog.has_error_handler():
176174
return
177175

178-
logging.error(f"Ignoring exception in command {context.command}", exc_info=exception)
176+
logging.error(
177+
f"Ignoring exception in command {context.command}", exc_info=exception
178+
)
179179

180180
async def can_run(self, ctx: Context, *, call_once: bool = False) -> bool:
181181
data = self._check_once if call_once else self._checks

discord/ext/tasks/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828
import asyncio
2929
import datetime
3030
import inspect
31-
import sys
3231
import logging
33-
import traceback
3432
from collections.abc import Sequence
3533
from typing import Any, Awaitable, Callable, Generic, TypeVar, cast
3634

@@ -50,6 +48,7 @@
5048

5149
_log = logging.getLogger(__name__)
5250

51+
5352
class SleepHandle:
5453
__slots__ = ("future", "loop", "handle")
5554

0 commit comments

Comments
 (0)