Skip to content

Commit fda2c9b

Browse files
authored
DEV: Remove ignore Ruff rule RET502 (#3208)
RET502: Do not implicitly `return None` in function able to return non-`None` value.
1 parent 76e4ed1 commit fda2c9b

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

pypdf/_writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2057,7 +2057,7 @@ def remove_objects_from_page(
20572057
if isinstance(to_delete, (list, tuple)):
20582058
for to_d in to_delete:
20592059
self.remove_objects_from_page(page, to_d)
2060-
return
2060+
return None
20612061
assert isinstance(to_delete, ObjectDeletionFlag)
20622062

20632063
if to_delete & ObjectDeletionFlag.LINKS:

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ ignore = [
172172
"PT014", # Ruff bug: Duplicate of test case at index 1 in `@pytest_mark.parametrize`
173173
"PTH123", # `open()` should be replaced by `Path.open()`
174174
"PYI042", # Type alias `mode_str_type` should be CamelCase
175-
"RET502", # Do not implicitly `return None` in function able to return non-`None` value
176175
"RET503", # Missing explicit `return` at the end of function able to return non-`None` value
177176
"RET505", # Unnecessary `else` after `return` statement
178177
"RUF001", # Detect confusable Unicode-to-Unicode units. Introduces bugs

tests/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,5 +168,5 @@ def __exit__(self, type_, value, traceback) -> Optional[bool]:
168168
ImageFile.LOAD_TRUNCATED_IMAGES = self._saved_load_truncated_images
169169
if type_:
170170
# Error.
171-
return
171+
return None
172172
return True

0 commit comments

Comments
 (0)