[commands] Fix Generic subcalsses used as a converter
This commit is contained in:
parent
cbbd31cc9f
commit
3b6a2b9e85
@ -29,6 +29,7 @@ import inspect
|
|||||||
from typing import (
|
from typing import (
|
||||||
Any,
|
Any,
|
||||||
Dict,
|
Dict,
|
||||||
|
Generic,
|
||||||
Iterable,
|
Iterable,
|
||||||
Literal,
|
Literal,
|
||||||
Optional,
|
Optional,
|
||||||
@ -995,6 +996,9 @@ async def run_converters(ctx: Context, converter, argument: str, param: inspect.
|
|||||||
"""
|
"""
|
||||||
origin = getattr(converter, '__origin__', None)
|
origin = getattr(converter, '__origin__', None)
|
||||||
|
|
||||||
|
if origin is not None and issubclass(converter, Generic): # type: ignore
|
||||||
|
converter = origin
|
||||||
|
|
||||||
if origin is Union:
|
if origin is Union:
|
||||||
errors = []
|
errors = []
|
||||||
_NoneType = type(None)
|
_NoneType = type(None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user