mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-13 01:09:50 +00:00
Reword missing annotation error to be a bit clearer
This commit is contained in:
parent
e813e5efe7
commit
7905d63f7c
@ -377,7 +377,7 @@ def _extract_parameters_from_callback(func: Callable[..., Any], globalns: Dict[s
|
|||||||
parameters: List[CommandParameter] = []
|
parameters: List[CommandParameter] = []
|
||||||
for parameter in iterator:
|
for parameter in iterator:
|
||||||
if parameter.annotation is parameter.empty:
|
if parameter.annotation is parameter.empty:
|
||||||
raise TypeError(f'annotation for {parameter.name} must be given in callback {func.__qualname__!r}')
|
raise TypeError(f'parameter {parameter.name!r} is missing a type annotation in callback {func.__qualname__!r}')
|
||||||
|
|
||||||
resolved = resolve_annotation(parameter.annotation, globalns, globalns, cache)
|
resolved = resolve_annotation(parameter.annotation, globalns, globalns, cache)
|
||||||
param = annotation_to_parameter(resolved, parameter)
|
param = annotation_to_parameter(resolved, parameter)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user