mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-24 18:13:00 +00:00
[commands] Only replace annotation if one was given
This commit is contained in:
@@ -310,7 +310,9 @@ class Command(_BaseCommand):
|
|||||||
|
|
||||||
for key, value in self.params.items():
|
for key, value in self.params.items():
|
||||||
# coalesce the forward references
|
# coalesce the forward references
|
||||||
self.params[key] = value = value.replace(annotation=type_hints.get(key))
|
if key in type_hints:
|
||||||
|
self.params[key] = value = value.replace(annotation=type_hints[key])
|
||||||
|
|
||||||
# fail early for when someone passes an unparameterized Greedy type
|
# fail early for when someone passes an unparameterized Greedy type
|
||||||
if value.annotation is converters.Greedy:
|
if value.annotation is converters.Greedy:
|
||||||
raise TypeError('Unparameterized Greedy[...] is disallowed in signature.')
|
raise TypeError('Unparameterized Greedy[...] is disallowed in signature.')
|
||||||
|
|||||||
Reference in New Issue
Block a user