Skip to content

Commit

Permalink
STY: Use f-string = functionality (#2835)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
j-t-1 and pubpub-zz authored Sep 13, 2024
1 parent 9d54f63 commit c4e95bd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pypdf/annotations/_non_markup_annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(
if is_external and is_internal:
raise ValueError(
"Either 'url' or 'target_page_index' have to be provided. "
f"url={url}, target_page_index={target_page_index}"
f"{url=}, {target_page_index=}"
)

border_arr: BorderArrayType
Expand Down
2 changes: 1 addition & 1 deletion pypdf/generic/_rectangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(
ArrayObject.__init__(self, [self._ensure_is_number(x) for x in arr]) # type: ignore

def _ensure_is_number(self, value: Any) -> Union[FloatObject, NumberObject]:
if not isinstance(value, (NumberObject, FloatObject)):
if not isinstance(value, (FloatObject, NumberObject)):
value = FloatObject(value)
return value

Expand Down
2 changes: 1 addition & 1 deletion tests/test_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,7 @@ def test_annotation_builder_link(pdf_file_path):
)
assert exc.value.args[0] == (
"Either 'url' or 'target_page_index' have to be provided. "
"url=https://martin-thoma.com/, target_page_index=3"
"url='https://martin-thoma.com/', target_page_index=3"
)

# Part 2: Too few args
Expand Down

0 comments on commit c4e95bd

Please sign in to comment.