@@ -254,13 +254,12 @@ def _info(self) -> Optional[DictionaryObject]:
254
254
info = self .trailer .get (TK .INFO , None )
255
255
if is_null_or_none (info ):
256
256
return None
257
- else :
258
- info = info .get_object ()
259
- if not isinstance (info , DictionaryObject ):
260
- raise PdfReadError (
261
- "Trailer not found or does not point to document information directory"
262
- )
263
- return info
257
+ info = info .get_object ()
258
+ if not isinstance (info , DictionaryObject ):
259
+ raise PdfReadError (
260
+ "Trailer not found or does not point to document information directory"
261
+ )
262
+ return info
264
263
265
264
@property
266
265
def _ID (self ) -> Optional [ArrayObject ]:
@@ -325,8 +324,7 @@ def _get_page_number_by_indirect(
325
324
else :
326
325
idnum = indirect_reference .idnum
327
326
assert self ._page_id2num is not None , "hint for mypy"
328
- ret = self ._page_id2num .get (idnum , None )
329
- return ret
327
+ return self ._page_id2num .get (idnum , None )
330
328
331
329
def _get_object_from_stream (
332
330
self , indirect_reference : IndirectObject
@@ -923,10 +921,8 @@ def _read_xref(self, stream: StreamType) -> Optional[int]:
923
921
)
924
922
stream .seek (p , 0 )
925
923
if "/Prev" in new_trailer :
926
- startxref = new_trailer ["/Prev" ]
927
- return startxref
928
- else :
929
- return None
924
+ return new_trailer ["/Prev" ]
925
+ return None
930
926
931
927
def _read_xref_other_error (
932
928
self , stream : StreamType , startxref : int
@@ -998,8 +994,7 @@ def get_entry(i: int) -> Union[int, Tuple[int, ...]]:
998
994
# W array indicates...the default value shall be used
999
995
if i == 0 :
1000
996
return 1 # First value defaults to 1
1001
- else :
1002
- return 0
997
+ return 0
1003
998
1004
999
def used_before (num : int , generation : Union [int , Tuple [int , ...]]) -> bool :
1005
1000
# We move backwards through the xrefs, don't replace any.
0 commit comments