aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_core/utils/function.py
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2024-02-19 21:35:56 +0000
committerGravatar Chris Lovering <[email protected]>2024-03-04 12:35:02 +0000
commitccd94c90d33b7aee85117078576684fab5055ce5 (patch)
treef54d2e3c71f12fe4613026d5a35ceae4dea4bd5a /pydis_core/utils/function.py
parentruff lint fix: Run remaining auto-fixable rules (diff)
ruff lint fix: Manual non-breaking changes
Diffstat (limited to 'pydis_core/utils/function.py')
-rw-r--r--pydis_core/utils/function.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pydis_core/utils/function.py b/pydis_core/utils/function.py
index 0df3a953..5c0d7ba4 100644
--- a/pydis_core/utils/function.py
+++ b/pydis_core/utils/function.py
@@ -51,9 +51,10 @@ def get_arg_value(name_or_pos: Argument, arguments: BoundArgs) -> typing.Any:
try:
_name, value = arg_values[arg_pos]
- return value
except IndexError:
raise ValueError(f"Argument position {arg_pos} is out of bounds.")
+ else:
+ return value
elif isinstance(name_or_pos, str):
arg_name = name_or_pos
try: