Skip to content

Commit 4990404

Browse files
committed
Removed Image._showxv
1 parent e444e7a commit 4990404

File tree

4 files changed

+17
-39
lines changed

4 files changed

+17
-39
lines changed

Tests/test_image.py

-16
Original file line numberDiff line numberDiff line change
@@ -626,22 +626,6 @@ def test_p_from_rgb_rgba(self):
626626
expected = Image.new(mode, (100, 100), color)
627627
assert_image_equal(im.convert(mode), expected)
628628

629-
def test_showxv_deprecation(self):
630-
class TestViewer(ImageShow.Viewer):
631-
def show_image(self, image, **options):
632-
return True
633-
634-
viewer = TestViewer()
635-
ImageShow.register(viewer, -1)
636-
637-
im = Image.new("RGB", (50, 50), "white")
638-
639-
with pytest.warns(DeprecationWarning):
640-
Image._showxv(im)
641-
642-
# Restore original state
643-
ImageShow._viewers.pop(0)
644-
645629
def test_no_resource_warning_on_save(self, tmp_path):
646630
# https://github.com/python-pillow/Pillow/issues/835
647631
# Arrange

docs/deprecations.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ Image.show command parameter
3333
The ``command`` parameter will be removed in Pillow 9.0.0 (2022-01-02).
3434
Use a subclass of :py:class:`.ImageShow.Viewer` instead.
3535

36-
Image._showxv
37-
~~~~~~~~~~~~~
38-
39-
.. deprecated:: 7.2.0
40-
41-
``Image._showxv`` will be removed in Pillow 9.0.0 (2022-01-02).
42-
Use :py:meth:`.Image.Image.show` instead. If custom behaviour is required, use
43-
:py:func:`.ImageShow.register` to add a custom :py:class:`.ImageShow.Viewer` class.
44-
4536
Tk/Tcl 8.4
4637
~~~~~~~~~~
4738

@@ -89,6 +80,15 @@ Removed features
8980
Deprecated features are only removed in major releases after an appropriate
9081
period of deprecation has passed.
9182

83+
Image._showxv
84+
~~~~~~~~~~~~~
85+
86+
.. deprecated:: 7.2.0
87+
.. versionremoved:: 9.0.0
88+
89+
Use :py:meth:`.Image.Image.show` instead. If custom behaviour is required, use
90+
:py:func:`.ImageShow.register` to add a custom :py:class:`.ImageShow.Viewer` class.
91+
9292
ImageFile.raise_ioerror
9393
~~~~~~~~~~~~~~~~~~~~~~~
9494

docs/releasenotes/9.0.0.rst

+7
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,10 @@ ImageFile.raise_ioerror
1414

1515
``IOError`` was merged into ``OSError`` in Python 3.3. So, ``ImageFile.raise_ioerror``
1616
has been removed. Use ``ImageFile.raise_oserror`` instead.
17+
18+
Image._showxv
19+
~~~~~~~~~~~~~
20+
21+
``Image._showxv`` has been removed. Use :py:meth:`~PIL.Image.Image.show`
22+
instead. If custom behaviour is required, use :py:meth:`~PIL.ImageShow.register` to add
23+
a custom :py:class:`~PIL.ImageShow.Viewer` class.

src/PIL/Image.py

+1-14
Original file line numberDiff line numberDiff line change
@@ -3233,22 +3233,9 @@ def register_encoder(name, encoder):
32333233

32343234

32353235
def _show(image, **options):
3236-
options["_internal_pillow"] = True
3237-
_showxv(image, **options)
3238-
3239-
3240-
def _showxv(image, title=None, **options):
32413236
from . import ImageShow
32423237

3243-
if "_internal_pillow" in options:
3244-
del options["_internal_pillow"]
3245-
else:
3246-
warnings.warn(
3247-
"_showxv is deprecated and will be removed in Pillow 9 (2022-01-02). "
3248-
"Use Image.show instead.",
3249-
DeprecationWarning,
3250-
)
3251-
ImageShow.show(image, title, **options)
3238+
ImageShow.show(image, **options)
32523239

32533240

32543241
# --------------------------------------------------------------------

0 commit comments

Comments
 (0)