[commands] Fix typing.Union converters for 3.7
Guido please don't break this
This commit is contained in:
parent
52767cf315
commit
69ca675ca0
@ -257,7 +257,12 @@ class Command:
|
|||||||
if converter is bool:
|
if converter is bool:
|
||||||
return _convert_to_bool(argument)
|
return _convert_to_bool(argument)
|
||||||
|
|
||||||
if type(converter) is typing._Union:
|
try:
|
||||||
|
origin = converter.__origin__
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
if origin is typing.Union:
|
||||||
errors = []
|
errors = []
|
||||||
for conv in converter.__args__:
|
for conv in converter.__args__:
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user