diff --git a/Tests/helper.py b/Tests/helper.py index aac5295df..ab2add282 100644 --- a/Tests/helper.py +++ b/Tests/helper.py @@ -246,7 +246,7 @@ class PillowLeakTestCase(PillowTestCase): if sys.platform == 'darwin': # man 2 getrusage: # ru_maxrss the maximum resident set size utilized (in bytes). - return mem / 1024 # Kb + return mem / 1024 # Kb else: # linux # man 2 getrusage diff --git a/Tests/test_file_gif.py b/Tests/test_file_gif.py index f8e3918b4..5dccde3ae 100644 --- a/Tests/test_file_gif.py +++ b/Tests/test_file_gif.py @@ -581,7 +581,7 @@ class TestFileGif(PillowTestCase): # see https://github.com/python-pillow/Pillow/issues/2811 im = Image.open('Tests/images/issue_2811.gif') - self.assertEqual(im.tile[0][3][0], 11) # LZW bits + self.assertEqual(im.tile[0][3][0], 11) # LZW bits # codec error prepatch im.load() diff --git a/Tests/test_file_png.py b/Tests/test_file_png.py index d64f9b7d9..8541c5f24 100644 --- a/Tests/test_file_png.py +++ b/Tests/test_file_png.py @@ -543,7 +543,7 @@ class TestFilePng(PillowTestCase): @unittest.skipIf(sys.platform.startswith('win32'), "requires Unix or MacOS") class TestTruncatedPngPLeaks(PillowLeakTestCase): mem_limit = 2*1024 # max increase in K - iterations = 100 # Leak is 56k/iteration, this will leak 5.6megs + iterations = 100 # Leak is 56k/iteration, this will leak 5.6megs def setUp(self): if "zip_encoder" not in codecs or "zip_decoder" not in codecs: diff --git a/Tests/test_font_leaks.py b/Tests/test_font_leaks.py index d3261a9e2..c44fa0ed2 100644 --- a/Tests/test_font_leaks.py +++ b/Tests/test_font_leaks.py @@ -8,12 +8,12 @@ from PIL import Image, features, ImageDraw, ImageFont class TestTTypeFontLeak(PillowLeakTestCase): # fails at iteration 3 in master iterations = 10 - mem_limit = 4096 #k + mem_limit = 4096 #k def _test_font(self, font): im = Image.new('RGB', (255,255), 'white') draw = ImageDraw.ImageDraw(im) - self._test_leak(lambda: draw.text((0, 0), "some text "*1024, #~10k + self._test_leak(lambda: draw.text((0, 0), "some text "*1024, #~10k font=font, fill="black")) @unittest.skipIf(not features.check('freetype2'), "Test requires freetype2") @@ -25,7 +25,7 @@ class TestTTypeFontLeak(PillowLeakTestCase): class TestDefaultFontLeak(TestTTypeFontLeak): # fails at iteration 37 in master iterations = 100 - mem_limit = 1024 #k + mem_limit = 1024 #k def test_leak(self): default_font = ImageFont.load_default() diff --git a/Tests/test_webp_leaks.py b/Tests/test_webp_leaks.py index 6feee0be6..c542ed811 100644 --- a/Tests/test_webp_leaks.py +++ b/Tests/test_webp_leaks.py @@ -8,7 +8,7 @@ test_file = "Tests/images/hopper.webp" @unittest.skipUnless(features.check('webp'), "WebP is not installed") class TestWebPLeaks(PillowLeakTestCase): - mem_limit = 3 * 1024 # kb + mem_limit = 3 * 1024 # kb iterations = 100 def test_leak_load(self): diff --git a/src/PIL/ImageFile.py b/src/PIL/ImageFile.py index 458857f41..f8dedaf93 100644 --- a/src/PIL/ImageFile.py +++ b/src/PIL/ImageFile.py @@ -188,7 +188,7 @@ class ImageFile(Image.Image): self.map = None self.load_prepare() - err_code = -3 # initialize to unknown error + err_code = -3 # initialize to unknown error if not self.map: # sort tiles in file order self.tile.sort(key=_tilesort) diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py index 8387cac14..ce6173453 100644 --- a/src/PIL/TiffImagePlugin.py +++ b/src/PIL/TiffImagePlugin.py @@ -572,7 +572,7 @@ class ImageFileDirectory_v2(collections.MutableMapping): if ((info.length == 1) or (info.length is None and len(values) == 1 and not legacy_api)): # Don't mess with the legacy api, since it's frozen. - if legacy_api and self.tagtype[tag] in [5, 10]: # rationals + if legacy_api and self.tagtype[tag] in [5, 10]: # rationals values = values, try: dest[tag], = values diff --git a/src/PIL/TiffTags.py b/src/PIL/TiffTags.py index 8700b62bf..427f3a489 100644 --- a/src/PIL/TiffTags.py +++ b/src/PIL/TiffTags.py @@ -193,8 +193,8 @@ TAGS_V2 = { 50741: ("MakerNoteSafety", SHORT, 1, {"Unsafe": 0, "Safe": 1}), 50780: ("BestQualityScale", RATIONAL, 1), - 50838: ("ImageJMetaDataByteCounts", LONG, 0), # Can be more than one - 50839: ("ImageJMetaData", UNDEFINED, 1) # see Issue #2006 + 50838: ("ImageJMetaDataByteCounts", LONG, 0), # Can be more than one + 50839: ("ImageJMetaData", UNDEFINED, 1) # see Issue #2006 } # Legacy Tags structure