don't show rawmode deprecation warning if mode is same as rawmode

The "BGR;15" and "BGR;16" modes being deprecated is separate from the "BGR;15" and "BGR;16" rawmodes being deprecated.
This commit is contained in:
Yay295 2024-06-22 10:23:25 -05:00
parent d330a136cd
commit 976f30709a

View File

@ -440,11 +440,13 @@ def _getdecoder(
elif not isinstance(args, tuple): elif not isinstance(args, tuple):
args = (args,) args = (args,)
if decoder_name == "raw" and args[0] in _DEPRECATED_RAWMODES: if decoder_name == "raw":
rawmode = args[0]
if mode != rawmode and rawmode in _DEPRECATED_RAWMODES:
deprecate( deprecate(
f"rawmode {args[0]}", f"rawmode {rawmode}",
12, 12,
replacement=f"rawmode {_DEPRECATED_RAWMODES[args[0]]}", replacement=f"rawmode {_DEPRECATED_RAWMODES[rawmode]}",
) )
try: try: