mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 02:06:18 +03:00
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:
parent
d330a136cd
commit
976f30709a
|
@ -440,12 +440,14 @@ def _getdecoder(
|
|||
elif not isinstance(args, tuple):
|
||||
args = (args,)
|
||||
|
||||
if decoder_name == "raw" and args[0] in _DEPRECATED_RAWMODES:
|
||||
deprecate(
|
||||
f"rawmode {args[0]}",
|
||||
12,
|
||||
replacement=f"rawmode {_DEPRECATED_RAWMODES[args[0]]}",
|
||||
)
|
||||
if decoder_name == "raw":
|
||||
rawmode = args[0]
|
||||
if mode != rawmode and rawmode in _DEPRECATED_RAWMODES:
|
||||
deprecate(
|
||||
f"rawmode {rawmode}",
|
||||
12,
|
||||
replacement=f"rawmode {_DEPRECATED_RAWMODES[rawmode]}",
|
||||
)
|
||||
|
||||
try:
|
||||
decoder = DECODERS[decoder_name]
|
||||
|
|
Loading…
Reference in New Issue
Block a user