CR feedback: don't use lambda

This commit is contained in:
Konstantin Kopachev 2016-06-29 17:29:55 -07:00
parent 885297d21f
commit 5f2fe6083c
No known key found for this signature in database
GPG Key ID: CECF757E656F4F62

View File

@ -327,8 +327,7 @@ class TestFilePng(PillowTestCase):
broken_crc_chunk_data = chunk_data[:-1] + b'q' # break CRC
image_data = HEAD + broken_crc_chunk_data + TAIL
self.assertRaises(SyntaxError,
lambda: PngImagePlugin.PngImageFile(BytesIO(image_data)))
self.assertRaises(SyntaxError, PngImagePlugin.PngImageFile, BytesIO(image_data))
ImageFile.LOAD_TRUNCATED_IMAGES = True
try:
@ -344,8 +343,7 @@ class TestFilePng(PillowTestCase):
ImageFile.LOAD_TRUNCATED_IMAGES = True
try:
self.assertRaises(SyntaxError,
lambda: PngImagePlugin.PngImageFile(BytesIO(image_data)))
self.assertRaises(SyntaxError, PngImagePlugin.PngImageFile, BytesIO(image_data))
finally:
ImageFile.LOAD_TRUNCATED_IMAGES = False