Merge pull request #2220 from jdufresne/image-draw-dep

Remove long deprecated ImageDraw methods
This commit is contained in:
wiredfool 2017-02-22 10:12:06 +00:00 committed by GitHub
commit a4ef743b0f
2 changed files with 0 additions and 23 deletions

View File

@ -31,7 +31,6 @@
#
import numbers
import warnings
from . import Image, ImageColor
from ._util import isStringType
@ -87,20 +86,6 @@ class ImageDraw(object):
self.fill = 0
self.font = None
def setink(self, ink):
raise NotImplementedError("setink() has been removed. " +
"Please use keyword arguments instead.")
def setfill(self, onoff):
raise NotImplementedError("setfill() has been removed. " +
"Please use keyword arguments instead.")
def setfont(self, font):
warnings.warn("setfont() is deprecated. " +
"Please set the attribute directly instead.")
# compatibility
self.font = font
def getfont(self):
"""Get the current default font."""
if not self.font:

View File

@ -44,14 +44,6 @@ class TestImageDraw(PillowTestCase):
draw.polygon(list(range(100)))
draw.rectangle(list(range(4)))
def test_removed_methods(self):
im = hopper()
draw = ImageDraw.Draw(im)
self.assertRaises(Exception, lambda: draw.setink(0))
self.assertRaises(Exception, lambda: draw.setfill(0))
def test_valueerror(self):
im = Image.open("Tests/images/chi.gif")