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): def assert_warning(self, warn_class, func, *args, **kwargs):
import warnings import warnings
result = None
with warnings.catch_warnings(record=True) as w: with warnings.catch_warnings(record=True) as w:
# Cause all warnings to always be triggered. # Cause all warnings to always be triggered.
warnings.simplefilter("always") warnings.simplefilter("always")

View File

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

View File

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

View File

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

View File

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

View File

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