Browse Source

[commands] fix Range to allow 3.10 Union syntax

pull/8447/head
Varun J 3 years ago
committed by GitHub
parent
commit
75fd49e6a1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      discord/ext/commands/converter.py

3
discord/ext/commands/converter.py

@ -1109,6 +1109,9 @@ else:
# Trick to allow it inside typing.Union
pass
def __or__(self, rhs) -> Any:
return Union[self, rhs]
def __class_getitem__(cls, obj) -> Range:
if not isinstance(obj, tuple):
raise TypeError(f'expected tuple for arguments, received {obj.__class__!r} instead')

Loading…
Cancel
Save