From 799a6a01052cea3f417a571d7c64cd14acc18c64 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Fri, 28 Oct 2022 18:03:38 +0300 Subject: [PATCH] Fix linting --- Tests/test_file_tiff.py | 3 +-- src/PIL/TiffImagePlugin.py | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Tests/test_file_tiff.py b/Tests/test_file_tiff.py index 5953dfa1814..4f3c8e39010 100644 --- a/Tests/test_file_tiff.py +++ b/Tests/test_file_tiff.py @@ -868,11 +868,10 @@ def test_timeout(self): def test_oom(self, test_file): with pytest.raises(UnidentifiedImageError): with pytest.warns(UserWarning): - with Image.open(test_file) as im: + with Image.open(test_file): pass - @pytest.mark.skipif(not is_win32(), reason="Windows only") class TestFileTiffW32: def test_fd_leak(self, tmp_path): diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py index 46166fc6335..1dfd5275fa1 100644 --- a/src/PIL/TiffImagePlugin.py +++ b/src/PIL/TiffImagePlugin.py @@ -1401,7 +1401,9 @@ def _setup(self): if samples_per_pixel > MAX_SAMPLESPERPIXEL: # DOS check, samples_per_pixel can be a Long, and we extend the tuple below - logger.error("More samples per pixel than can be decoded: %s", samples_per_pixel) + logger.error( + "More samples per pixel than can be decoded: %s", samples_per_pixel + ) raise SyntaxError("Invalid value for samples per pixel") if samples_per_pixel < bps_actual_count: