Remove unused local variables

This commit is contained in:
Hugo 2018-10-02 11:44:43 +03:00
parent bac99bd5ae
commit 619e5fde8d
6 changed files with 19 additions and 20 deletions

View File

@ -163,7 +163,6 @@ class PillowTestCase(unittest.TestCase):
def assert_warning(self, warn_class, func, *args, **kwargs):
import warnings
result = None
with warnings.catch_warnings(record=True) as w:
# Cause all warnings to always be triggered.
warnings.simplefilter("always")

View File

@ -9,7 +9,7 @@ class TestSanity(PillowTestCase):
def test_sanity(self):
# Make sure we have the binary extension
im = PIL.Image.core.new("L", (100, 100))
PIL.Image.core.new("L", (100, 100))
self.assertEqual(PIL.Image.VERSION[:3], '1.1')
@ -19,11 +19,11 @@ class TestSanity(PillowTestCase):
self.assertEqual(len(im.tobytes()), 1300)
# Create images in all remaining major modes.
im = PIL.Image.new("L", (100, 100))
im = PIL.Image.new("P", (100, 100))
im = PIL.Image.new("RGB", (100, 100))
im = PIL.Image.new("I", (100, 100))
im = PIL.Image.new("F", (100, 100))
PIL.Image.new("L", (100, 100))
PIL.Image.new("P", (100, 100))
PIL.Image.new("RGB", (100, 100))
PIL.Image.new("I", (100, 100))
PIL.Image.new("F", (100, 100))
if __name__ == '__main__':

View File

@ -82,19 +82,19 @@ class TestFilePng(PillowTestCase):
self.assertEqual(im.format, "PNG")
hopper("1").save(test_file)
im = Image.open(test_file)
Image.open(test_file)
hopper("L").save(test_file)
im = Image.open(test_file)
Image.open(test_file)
hopper("P").save(test_file)
im = Image.open(test_file)
Image.open(test_file)
hopper("RGB").save(test_file)
im = Image.open(test_file)
Image.open(test_file)
hopper("I").save(test_file)
im = Image.open(test_file)
Image.open(test_file)
def test_invalid_file(self):
invalid_file = "Tests/images/flower.jpg"

View File

@ -26,19 +26,19 @@ class TestFileTiff(PillowTestCase):
self.assertEqual(im.format, "TIFF")
hopper("1").save(filename)
im = Image.open(filename)
Image.open(filename)
hopper("L").save(filename)
im = Image.open(filename)
Image.open(filename)
hopper("P").save(filename)
im = Image.open(filename)
Image.open(filename)
hopper("RGB").save(filename)
im = Image.open(filename)
Image.open(filename)
hopper("I").save(filename)
im = Image.open(filename)
Image.open(filename)
def test_mac_tiff(self):
# Read RGBa images from macOS [@PIL136]

View File

@ -204,7 +204,7 @@ class TestPyDecoder(PillowTestCase):
im = MockImageFile(buf)
im.tile = [("MOCK", (xoff, yoff, -10, yoff+ysize), 32, None)]
d = self.get_decoder()
self.get_decoder()
self.assertRaises(ValueError, im.load)
@ -218,7 +218,7 @@ class TestPyDecoder(PillowTestCase):
im.tile = [
("MOCK", (xoff, yoff, xoff+xsize + 100, yoff+ysize), 32, None)
]
d = self.get_decoder()
self.get_decoder()
self.assertRaises(ValueError, im.load)

View File

@ -86,7 +86,7 @@ if ImageQt.qt_is_installed:
pixmap1 = QtGui.QPixmap.fromImage(qimage)
hbox = QHBoxLayout(self)
QHBoxLayout(self)
lbl = QLabel(self)
# Segfault in the problem