diff --git a/pypdf/annotations/_non_markup_annotations.py b/pypdf/annotations/_non_markup_annotations.py index 6272cceee..af02223e7 100644 --- a/pypdf/annotations/_non_markup_annotations.py +++ b/pypdf/annotations/_non_markup_annotations.py @@ -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 diff --git a/pypdf/generic/_rectangle.py b/pypdf/generic/_rectangle.py index 690b52172..c1f22cebc 100644 --- a/pypdf/generic/_rectangle.py +++ b/pypdf/generic/_rectangle.py @@ -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 diff --git a/tests/test_generic.py b/tests/test_generic.py index 2616ec6af..190bb25e6 100644 --- a/tests/test_generic.py +++ b/tests/test_generic.py @@ -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