Skip to content

Commit

Permalink
Revert to HEAD~2
Browse files Browse the repository at this point in the history
  • Loading branch information
norinorin authored and tandemdude committed Jun 14, 2021
1 parent a54e52c commit a1b8cd5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lightbulb/command_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ class useful for extracting the arguments from the raw string and the property
conv = converters.pop(0)
arg_name = arg_names.pop(0)

if not isinstance(conv, _DefaultingConverter) and not getattr(conv, "unpack", False) and not arg_string:
if not isinstance(conv, (_DefaultingConverter, _GreedyConverter)) and not arg_string:
raise errors.NotEnoughArguments(command, [arg_name, *arg_names])

try:
Expand Down
6 changes: 2 additions & 4 deletions lightbulb/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def parse_signature(self, signature: inspect.Signature):
if idx == 0 or (idx == 1 and self.has_self):
continue

converter = base_converter = self.get_converter(param.annotation)
converter: _BaseConverter = self.get_converter(param.annotation)

if param.kind is inspect.Parameter.KEYWORD_ONLY:
converter = _ConsumeRestConverter(converter, param.name)
Expand All @@ -197,9 +197,7 @@ def parse_signature(self, signature: inspect.Signature):

if param.default is not inspect.Parameter.empty:
if not isinstance(converter, _DefaultingConverter):
converter = _DefaultingConverter(
converter, param.default, raise_on_fail=not isinstance(base_converter, _GreedyConverter)
)
converter = _DefaultingConverter(converter, param.default)
else:
converter.default = param.default

Expand Down
3 changes: 0 additions & 3 deletions lightbulb/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,9 +540,6 @@ async def convert(
except Exception:
break

if not converted and not self.unpack:
raise errors.ConverterFailure

return converted, prev


Expand Down

0 comments on commit a1b8cd5

Please sign in to comment.