From d85dffd15077ff6a040e0334866b81f6c4500551 Mon Sep 17 00:00:00 2001 From: hugovk Date: Sat, 27 May 2017 21:52:43 +0300 Subject: [PATCH] Remove functions deprecated and warning since 2.0 (15 Mar 2013) and raising exceptions since 3.0 (1 Oct 2015) --- PIL/ImageWin.py | 8 -------- Tests/test_imagewin.py | 9 --------- docs/releasenotes/4.2.0.rst | 9 +++++++++ docs/releasenotes/index.rst | 1 + 4 files changed, 10 insertions(+), 17 deletions(-) create mode 100644 docs/releasenotes/4.2.0.rst diff --git a/PIL/ImageWin.py b/PIL/ImageWin.py index cc4dced97..d8398e92b 100644 --- a/PIL/ImageWin.py +++ b/PIL/ImageWin.py @@ -182,14 +182,6 @@ class Dib(object): """ return self.image.tobytes() - def fromstring(self, *args, **kw): - raise NotImplementedError("fromstring() has been removed. " + - "Please use frombytes() instead.") - - def tostring(self, *args, **kw): - raise NotImplementedError("tostring() has been removed. " + - "Please use tobytes() instead.") - class Window(object): """Create a Window with the given title size.""" diff --git a/Tests/test_imagewin.py b/Tests/test_imagewin.py index d802b1fb2..70bf28247 100644 --- a/Tests/test_imagewin.py +++ b/Tests/test_imagewin.py @@ -107,15 +107,6 @@ class TestImageWinDib(PillowTestCase): # Confirm they're the same self.assertEqual(dib1.tobytes(), dib2.tobytes()) - def test_removed_methods(self): - # Arrange - im = hopper() - dib = ImageWin.Dib(im) - - # Act/Assert - self.assertRaises(Exception, dib.tostring) - self.assertRaises(Exception, dib.fromstring) - if __name__ == '__main__': unittest.main() diff --git a/docs/releasenotes/4.2.0.rst b/docs/releasenotes/4.2.0.rst new file mode 100644 index 000000000..2e1d5dd40 --- /dev/null +++ b/docs/releasenotes/4.2.0.rst @@ -0,0 +1,9 @@ +4.2.0 +----- + +Removed Deprecated Items +======================== + +Several deprecated items have been removed. + +* The methods :py:meth:`PIL.ImageWin.Dib.fromstring` and :py:meth:`PIL.ImageWin.Dib.tostring` have been removed. diff --git a/docs/releasenotes/index.rst b/docs/releasenotes/index.rst index 27851ec7a..624c727a9 100644 --- a/docs/releasenotes/index.rst +++ b/docs/releasenotes/index.rst @@ -6,6 +6,7 @@ Release Notes .. toctree:: :maxdepth: 2 + 4.2.0 4.1.1 4.1.0 4.0.0