[commands] use __args__ and __origin__ where applicable

This commit is contained in:
Josh
2021-04-11 14:38:17 +10:00
committed by GitHub
parent c54c4cb215
commit 7f91ae8b67
2 changed files with 27 additions and 17 deletions

View File

@@ -23,7 +23,6 @@ DEALINGS IN THE SOFTWARE.
"""
from discord.errors import ClientException, DiscordException
import typing
__all__ = (
@@ -646,7 +645,7 @@ class BadUnionArgument(UserInputError):
try:
return x.__name__
except AttributeError:
if typing.get_origin(x) is not None:
if hasattr(x, '__origin__'):
return repr(x)
return x.__class__.__name__