From 613840ebcf303e84048d48ace37fb001c1afe687 Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Sat, 6 May 2023 16:12:32 +0100 Subject: Apply fixes for ruff linting Co-authored-by: wookie184 Co-authored-by: Amrou Bellalouna --- bot/exts/core/source.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'bot/exts/core/source.py') diff --git a/bot/exts/core/source.py b/bot/exts/core/source.py index f771eaca..592156fc 100644 --- a/bot/exts/core/source.py +++ b/bot/exts/core/source.py @@ -1,6 +1,5 @@ import inspect from pathlib import Path -from typing import Optional from discord import Embed from discord.ext import commands @@ -28,7 +27,7 @@ class BotSource(commands.Cog): embed = await self.build_embed(source_item) await ctx.send(embed=embed) - def get_source_link(self, source_item: SourceType) -> tuple[str, str, Optional[int]]: + def get_source_link(self, source_item: SourceType) -> tuple[str, str, int | None]: """ Build GitHub link of source item, return this link, file location and first line number. @@ -62,7 +61,7 @@ class BotSource(commands.Cog): return url, file_location, first_line_no or None - async def build_embed(self, source_object: SourceType) -> Optional[Embed]: + async def build_embed(self, source_object: SourceType) -> Embed | None: """Build embed based on source object.""" url, location, first_line = self.get_source_link(source_object) -- cgit v1.2.3