From 96711cc07c1cf81e815345a0003f084015d21ccd Mon Sep 17 00:00:00 2001 From: Martin Thoma Date: Sun, 8 May 2022 10:52:19 +0200 Subject: [PATCH] MAINT: Remove star imports (#865) --- PyPDF2/_merger.py | 15 ++++++++++++++- PyPDF2/filters.py | 2 +- PyPDF2/generic.py | 5 ++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/PyPDF2/_merger.py b/PyPDF2/_merger.py index c998b32d8..4f76950bc 100644 --- a/PyPDF2/_merger.py +++ b/PyPDF2/_merger.py @@ -32,7 +32,20 @@ from PyPDF2._reader import PdfFileReader from PyPDF2._writer import PdfFileWriter from PyPDF2.constants import PagesAttributes as PA -from PyPDF2.generic import * +from PyPDF2.generic import ( + ArrayObject, + Bookmark, + Destination, + DictionaryObject, + FloatObject, + IndirectObject, + NameObject, + NullObject, + NumberObject, + TextStringObject, + TreeObject, + createStringObject, +) from PyPDF2.pagerange import PageRange, PageRangeSpec from PyPDF2.types import ( BookmarkTypes, diff --git a/PyPDF2/filters.py b/PyPDF2/filters.py index dccfebe03..7ebbf98a5 100644 --- a/PyPDF2/filters.py +++ b/PyPDF2/filters.py @@ -509,7 +509,7 @@ def decode( def decodeStreamData(stream: Any) -> Union[str, bytes]: # utils.StreamObject - from .generic import NameObject + from PyPDF2.generic import NameObject filters = stream.get(SA.FILTER, ()) diff --git a/PyPDF2/generic.py b/PyPDF2/generic.py index 368c03641..0e3ec68a5 100644 --- a/PyPDF2/generic.py +++ b/PyPDF2/generic.py @@ -40,6 +40,7 @@ from io import BytesIO from typing import Any, Dict, Iterable, List, Optional, Tuple, Union +from PyPDF2 import utils from PyPDF2.constants import FilterTypes as FT from PyPDF2.constants import StreamAttributes as SA from PyPDF2.errors import ( @@ -48,9 +49,7 @@ PdfReadWarning, PdfStreamError, ) - -from . import utils -from .utils import ( +from PyPDF2.utils import ( RC4_encrypt, StreamType, b_,