From a2a033ad2d6636aa40a89d9dbf5ef1deecd0e4cb Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Tue, 23 Sep 2014 13:59:35 +0300 Subject: [PATCH] Mention that Image.tostring() is deprecated This mirrors the deprecation notice in the docstring of fromstring(). I'm assuming that tostring() and fromstring() were both deprecated at the same time (Pillow 2.0); I haven't gone out of my way to verify that assumption. --- PIL/Image.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PIL/Image.py b/PIL/Image.py index 54291fbdd..cad13c3b6 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -664,6 +664,10 @@ class Image: # Declare tostring as alias to tobytes def tostring(self, *args, **kw): + """Deprecated alias to tobytes. + + .. deprecated:: 2.0 + """ warnings.warn( 'tostring() is deprecated. Please call tobytes() instead.', DeprecationWarning,