mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 01:04:29 +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):
|
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]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user