Remove function deprecated and warning since 3.0 (1 Oct 2015)

This commit is contained in:
hugovk 2017-05-27 21:55:42 +03:00
parent d85dffd150
commit e002207c5b
2 changed files with 4 additions and 23 deletions

View File

@ -462,15 +462,6 @@ class ImageFileDirectory_v2(collections.MutableMapping):
def __str__(self): def __str__(self):
return str(dict(self)) return str(dict(self))
def as_dict(self):
"""Return a dictionary of the image's tags.
.. deprecated:: 3.0.0
"""
warnings.warn("as_dict() is deprecated. " +
"Please use dict(ifd) instead.", DeprecationWarning)
return dict(self)
def named(self): def named(self):
""" """
:returns: dict of name|key: value :returns: dict of name|key: value

View File

@ -274,16 +274,6 @@ class TestFileTiff(PillowTestCase):
# Assert # Assert
self.assertIsInstance(ret, str) self.assertIsInstance(ret, str)
def test_as_dict_deprecation(self):
# Arrange
filename = "Tests/images/pil136.tiff"
im = Image.open(filename)
self.assert_warning(DeprecationWarning, im.tag_v2.as_dict)
self.assert_warning(DeprecationWarning, im.tag.as_dict)
self.assertEqual(dict(im.tag_v2), im.tag_v2.as_dict())
self.assertEqual(dict(im.tag), im.tag.as_dict())
def test_dict(self): def test_dict(self):
# Arrange # Arrange
filename = "Tests/images/pil136.tiff" filename = "Tests/images/pil136.tiff"
@ -484,7 +474,7 @@ class TestFileTiff(PillowTestCase):
def test_close_on_load_nonexclusive(self): def test_close_on_load_nonexclusive(self):
tmpfile = self.tempfile("temp.tif") tmpfile = self.tempfile("temp.tif")
with Image.open("Tests/images/uint16_1_4660.tif") as im: with Image.open("Tests/images/uint16_1_4660.tif") as im:
im.save(tmpfile) im.save(tmpfile)
@ -495,7 +485,7 @@ class TestFileTiff(PillowTestCase):
im.load() im.load()
self.assertFalse(fp.closed) self.assertFalse(fp.closed)
@unittest.skipUnless(sys.platform.startswith('win32'), "Windows only") @unittest.skipUnless(sys.platform.startswith('win32'), "Windows only")
class TestFileTiffW32(PillowTestCase): class TestFileTiffW32(PillowTestCase):
@ -503,7 +493,7 @@ class TestFileTiffW32(PillowTestCase):
tmpfile = self.tempfile("temp.tif") tmpfile = self.tempfile("temp.tif")
import os import os
# this is an mmaped file. # this is an mmaped file.
with Image.open("Tests/images/uint16_1_4660.tif") as im: with Image.open("Tests/images/uint16_1_4660.tif") as im:
im.save(tmpfile) im.save(tmpfile)
@ -516,7 +506,7 @@ class TestFileTiffW32(PillowTestCase):
# this closes the mmap # this closes the mmap
im.close() im.close()
# this should not fail, as load should have closed the file pointer, # this should not fail, as load should have closed the file pointer,
# and close should have closed the mmap # and close should have closed the mmap
os.remove(tmpfile) os.remove(tmpfile)