We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d23d56e commit 79e0b0bCopy full SHA for 79e0b0b
2 files changed
src/PIL/PngImagePlugin.py
@@ -1370,7 +1370,7 @@ def _save(
1370
msg = f"cannot write mode {mode} as PNG"
1371
raise OSError(msg) from e
1372
if outmode == "I":
1373
- deprecate("Saving I mode images as PNG", 13)
+ deprecate("Saving I mode images as PNG", 13, stacklevel=4)
1374
1375
#
1376
# write minimal PNG file
src/PIL/_deprecate.py
@@ -12,6 +12,7 @@ def deprecate(
12
*,
13
action: str | None = None,
14
plural: bool = False,
15
+ stacklevel: int = 3,
16
) -> None:
17
"""
18
Deprecations helper.
@@ -67,5 +68,5 @@ def deprecate(
67
68
warnings.warn(
69
f"{deprecated} {is_} deprecated and will be removed in {removed}{action}",
70
DeprecationWarning,
- stacklevel=3,
71
+ stacklevel=stacklevel,
72
)
0 commit comments