Skip to content

Commit 355aa00

Browse files
committed
style: Adjust code to comply with latest Ruff
1 parent 501ec58 commit 355aa00

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pelican/plugins/image_process/image_process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ def compute_paths(img, settings, derivative):
374374
process_dir = settings["IMAGE_PROCESS_DIR"]
375375
img_src = urlparse(img["src"])
376376
img_src_path = url2pathname(img_src.path.lstrip("/"))
377-
img_src_dirname, filename = os.path.split(img_src_path)
377+
_img_src_dirname, filename = os.path.split(img_src_path)
378378
derivative_path = os.path.join(process_dir, derivative)
379379
# urljoin truncates leading ../ elements
380380
base_url = posixpath.join(

pelican/plugins/image_process/test_image_process.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,22 +123,22 @@ def test_all_transforms(tmp_path, transform_id, transform_params, image_path):
123123
# depending on the platform on which they are run.
124124
if transformed.mode == "RGB":
125125
for _, (transformed_pixel, expected_pixel) in enumerate(
126-
zip(transformed.getdata(), expected.getdata())
126+
zip(transformed.getdata(), expected.getdata(), strict=False)
127127
):
128128
assert abs(transformed_pixel[0] - expected_pixel[0]) <= 1
129129
assert abs(transformed_pixel[1] - expected_pixel[1]) <= 1
130130
assert abs(transformed_pixel[2] - expected_pixel[2]) <= 1
131131
elif transformed.mode == "RGBA":
132132
for _, (transformed_pixel, expected_pixel) in enumerate(
133-
zip(transformed.getdata(), expected.getdata())
133+
zip(transformed.getdata(), expected.getdata(), strict=False)
134134
):
135135
assert abs(transformed_pixel[0] - expected_pixel[0]) <= 1
136136
assert abs(transformed_pixel[1] - expected_pixel[1]) <= 1
137137
assert abs(transformed_pixel[2] - expected_pixel[2]) <= 1
138138
assert abs(transformed_pixel[3] - expected_pixel[3]) <= 1
139139
elif transformed.mode == "L":
140140
for _, (transformed_pixel, expected_pixel) in enumerate(
141-
zip(transformed.getdata(), expected.getdata())
141+
zip(transformed.getdata(), expected.getdata(), strict=False)
142142
):
143143
assert abs(transformed_pixel - expected_pixel) <= 1
144144
else:

0 commit comments

Comments
 (0)