mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-02 00:00:02 +00:00
Fix Optional normalisation not working properly
This commit is contained in:
parent
ae1aaac5a7
commit
26fc694189
@ -1047,9 +1047,6 @@ def evaluate_annotation(
|
|||||||
if is_literal and not all(isinstance(x, (str, int, bool, type(None))) for x in evaluated_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, or NoneType.')
|
raise TypeError('Literal arguments must be of type str, int, bool, or NoneType.')
|
||||||
|
|
||||||
if evaluated_args == args:
|
|
||||||
return tp
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return tp.copy_with(evaluated_args)
|
return tp.copy_with(evaluated_args)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user