Browse Source
[commands] Update error message for Literal float/complex
pull/6814/head
Olivia
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
discord/utils.py
|
|
@ -866,7 +866,7 @@ def evaluate_annotation( |
|
|
|
evaluated_args = tuple(evaluate_annotation(arg, globals, locals, cache, implicit_str=implicit_str) for arg in args) |
|
|
|
|
|
|
|
if is_literal and not all(isinstance(x, (str, int, bool, type(None))) for x in evaluated_args): |
|
|
|
raise TypeError('Literal arguments must be of type str, int, bool, float or complex.') |
|
|
|
raise TypeError('Literal arguments must be of type str, int, bool, or NoneType.') |
|
|
|
|
|
|
|
if evaluated_args == args: |
|
|
|
return tp |
|
|
|