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,12 +440,14 @@ 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":
deprecate( rawmode = args[0]
f"rawmode {args[0]}", if mode != rawmode and rawmode in _DEPRECATED_RAWMODES:
12, deprecate(
replacement=f"rawmode {_DEPRECATED_RAWMODES[args[0]]}", f"rawmode {rawmode}",
) 12,
replacement=f"rawmode {_DEPRECATED_RAWMODES[rawmode]}",
)
try: try:
decoder = DECODERS[decoder_name] decoder = DECODERS[decoder_name]