Skip to content

Commit c4e95bd

Browse files
j-t-1pubpub-zz
andauthored
STY: Use f-string = functionality (#2835)
* STY: Use f-string = functionality * STY: Use f-string = functionality * STY: Use f-string = functionality Also switch the order of a tuple to match the order of the line above. --------- Co-authored-by: pubpub-zz <4083478+pubpub-zz@users.noreply.github.com>
1 parent 9d54f63 commit c4e95bd

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

pypdf/annotations/_non_markup_annotations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(
3636
if is_external and is_internal:
3737
raise ValueError(
3838
"Either 'url' or 'target_page_index' have to be provided. "
39-
f"url={url}, target_page_index={target_page_index}"
39+
f"{url=}, {target_page_index=}"
4040
)
4141

4242
border_arr: BorderArrayType

pypdf/generic/_rectangle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(
2626
ArrayObject.__init__(self, [self._ensure_is_number(x) for x in arr]) # type: ignore
2727

2828
def _ensure_is_number(self, value: Any) -> Union[FloatObject, NumberObject]:
29-
if not isinstance(value, (NumberObject, FloatObject)):
29+
if not isinstance(value, (FloatObject, NumberObject)):
3030
value = FloatObject(value)
3131
return value
3232

tests/test_generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ def test_annotation_builder_link(pdf_file_path):
981981
)
982982
assert exc.value.args[0] == (
983983
"Either 'url' or 'target_page_index' have to be provided. "
984-
"url=https://martin-thoma.com/, target_page_index=3"
984+
"url='https://martin-thoma.com/', target_page_index=3"
985985
)
986986

987987
# Part 2: Too few args

0 commit comments

Comments
 (0)