Browse Source

[commands] Fix typing.Union converters for 3.7

Guido please don't break this
pull/1445/head
Rapptz 7 years ago
parent
commit
69ca675ca0
  1. 7
      discord/ext/commands/core.py

7
discord/ext/commands/core.py

@ -257,7 +257,12 @@ class Command:
if converter is bool:
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 = []
for conv in converter.__args__:
try:

Loading…
Cancel
Save