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.
This commit is contained in:
Marius Gedminas 2014-09-23 13:59:35 +03:00
parent bf22cdebd1
commit a2a033ad2d

View File

@ -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,