diff options
| author | 2025-11-10 19:44:23 +0000 | |
|---|---|---|
| committer | 2025-11-10 23:19:27 +0000 | |
| commit | 2fa5aa2037616b0cfd61ac67f6d145e6da12723a (patch) | |
| tree | c6b05249a01a600f485281c12dcbbfba0657e523 /pydis_core/exts | |
| parent | Unignore B904 (raise-without-from-inside-except) (diff) | |
Fix B904 across project (raise-without-from-except-inside)12.x
Diffstat (limited to 'pydis_core/exts')
| -rw-r--r-- | pydis_core/exts/source.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pydis_core/exts/source.py b/pydis_core/exts/source.py index ded9c7aa..b53fe859 100644 --- a/pydis_core/exts/source.py +++ b/pydis_core/exts/source.py @@ -129,14 +129,14 @@ class SourceCode(commands.Cog, description="Displays information about the bot's src = type(source_item) try: filename = inspect.getsourcefile(src) - except TypeError: - raise commands.BadArgument("Cannot get source for a dynamically-created object.") + except TypeError as e: + raise commands.BadArgument("Cannot get source for a dynamically-created object.") from e if source_type != _SourceType.tag: try: lines, first_line_no = inspect.getsourcelines(src) - except OSError: - raise commands.BadArgument("Cannot get source for a dynamically-created object.") + except OSError as e: + raise commands.BadArgument("Cannot get source for a dynamically-created object.") from e lines_extension = f"#L{first_line_no}-L{first_line_no+len(lines)-1}" else: |