[commands] Only replace annotation if one was given

This commit is contained in:
Rapptz 2021-04-07 03:17:10 -04:00
parent 89456022cf
commit f80b8d3f5d

View File

@ -310,7 +310,9 @@ class Command(_BaseCommand):
for key, value in self.params.items():
# 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
if value.annotation is converters.Greedy:
raise TypeError('Unparameterized Greedy[...] is disallowed in signature.')