diff options
| author | 2025-11-10 19:44:23 +0000 | |
|---|---|---|
| committer | 2025-11-10 19:45:42 +0000 | |
| commit | 3b5c355314e602a40081b73e8502ac34314c7d9b (patch) | |
| tree | 606085ba052746d1018d56fa0eca255adde4e387 /pydis_core/exts | |
| parent | Unignore B904 (raise-without-from-inside-except) (diff) | |
Fix B904 across project (raise-without-from-except-inside)
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 064dcb2d..1770258d 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: |